File: test_518_header_guid.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (20 lines) | stat: -rw-r--r-- 454 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#  Copyright (c) 2021, Manfred Moitzi
#  License: MIT License

import pytest
import re
from ezdxf.tools import guid

HEX4 = "[0-9A-F]{4}"
HEX8 = "[0-9A-F]{8}"
HEX12 = "[0-9A-F]{12}"
# "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
AUTOCAD_PATTERN = f"{{{HEX8}-{HEX4}-{HEX4}-{HEX4}-{HEX12}}}"


def test_guid_string_matches_autocad_pattern():
    assert re.fullmatch(AUTOCAD_PATTERN, guid()) is not None


if __name__ == "__main__":
    pytest.main([__file__])