diff --git a/UnitTests/Subset/SubsetTemplateCreator_test.py b/UnitTests/Subset/SubsetTemplateCreator_test.py index bde5c2a..8a4542a 100644 --- a/UnitTests/Subset/SubsetTemplateCreator_test.py +++ b/UnitTests/Subset/SubsetTemplateCreator_test.py @@ -47,7 +47,8 @@ def test_subset_with_AllCasesTestClass_no_double_kard_excel(): excel_path = Path(ROOT_DIR) / 'testFileStorage' / 'OTL_AllCasesTestClass_no_double_kard.xlsx' subset_tool.generate_template_from_subset(path_to_subset=Path(ROOT_DIR) / 'OTL_AllCasesTestClass_no_double_kard.db', path_to_template_file_and_extension=excel_path, amount_of_examples=1, - split_per_type=True, model_directory=model_directory_path) + split_per_type=True, model_directory=model_directory_path, + add_geo_artefact=True) assert excel_path.exists() book = openpyxl.load_workbook(excel_path, data_only=True, read_only=True) @@ -65,7 +66,7 @@ def test_subset_with_AllCasesTestClass_no_double_kard_excel(): header_row_list = [header for header in header_row_list if not header.startswith('testUnionType')] assert header_row_list == ['typeURI', 'assetId.identificator', 'assetId.toegekendDoor', 'bestekPostNummer[]', - 'datumOprichtingObject', 'isActief', 'notitie', 'standaardBestekPostNummer[]', + 'datumOprichtingObject', 'geometry', 'isActief', 'notitie', 'standaardBestekPostNummer[]', 'testBooleanField', 'testComplexType.testBooleanField', 'testComplexType.testComplexType2.testKwantWrd', 'testComplexType.testComplexType2.testStringField', diff --git a/otlmow_template/SubsetTemplateCreator.py b/otlmow_template/SubsetTemplateCreator.py index 12b5749..96483a8 100644 --- a/otlmow_template/SubsetTemplateCreator.py +++ b/otlmow_template/SubsetTemplateCreator.py @@ -95,6 +95,11 @@ def generate_basic_template(self, path_to_subset: Path, path_to_template_file_an for attribute_object in attributen: attr = getattr(instance, '_' + attribute_object.name) attr.fill_with_dummy_data() + try: + geo_attr = getattr(instance, '_geometry') + geo_attr.fill_with_dummy_data() + except AttributeError: + pass otl_objects.append(instance) DotnotationHelper.clear_list_of_list_attributes(instance) diff --git a/pyproject.toml b/pyproject.toml index f8de3a4..6138d83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "otlmow_template" -version = "0.7" +version = "0.8" authors = [{name = "David Vlaminck", email = "david.vlaminck@mow.vlaanderen.be"}, {name = "Jasper Berton", email = "jasperberton1@telenet.be"},] readme = "README.md" @@ -29,7 +29,7 @@ classifiers = [ ] requires-python = ">=3.9" dependencies = [ - 'otlmow-converter >= 1.6', + 'otlmow-converter >= 1.7', 'otlmow-modelbuilder >= 0.24', ]