|
57 | 57 | from cyclonedx.schema import OutputFormat, SchemaVersion |
58 | 58 | from cyclonedx.schema._res import BOM_JSON as SCHEMA_JSON, BOM_XML as SCHEMA_XML |
59 | 59 | from cyclonedx.validation import make_schemabased_validator |
60 | | -from tests import SnapshotMixin |
| 60 | +from tests import PROJECT_LIB_MODELS_DIRECTORY, SnapshotMixin |
61 | 61 | from tests._data.models import _make_bom |
62 | 62 |
|
63 | 63 | # region SUT: all the enums |
@@ -1006,10 +1006,9 @@ def __get_defined_enumcases(cls) -> tuple[str, ...]: |
1006 | 1006 |
|
1007 | 1007 | @staticmethod |
1008 | 1008 | def __get_defined_model_enums() -> Generator[tuple[str, str], None, None]: |
1009 | | - models_path = path.abspath(path.join(path.dirname(__file__), '..', 'cyclonedx', 'model')) |
1010 | | - model_files = glob(path.join(models_path, '**', '*.py'), recursive=True) |
| 1009 | + model_files = glob(path.join(PROJECT_LIB_MODELS_DIRECTORY, '**', '*.py'), recursive=True) |
1011 | 1010 | for model_file in model_files: |
1012 | | - model_file_rel = path.relpath(model_file, models_path) |
| 1011 | + model_file_rel = path.relpath(model_file, PROJECT_LIB_MODELS_DIRECTORY) |
1013 | 1012 | with open(model_file, encoding='utf-8') as f: |
1014 | 1013 | tree = ast.parse(f.read(), filename=model_file) |
1015 | 1014 | for node in ast.walk(tree): |
|
0 commit comments