Skip to content

Commit

Permalink
fix for geometry attribute v0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvlaminck committed Dec 6, 2024
1 parent fd87155 commit 988b886
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions UnitTests/Subset/SubsetTemplateCreator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions otlmow_template/SubsetTemplateCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,7 +29,7 @@ classifiers = [
]
requires-python = ">=3.9"
dependencies = [
'otlmow-converter >= 1.6',
'otlmow-converter >= 1.7',
'otlmow-modelbuilder >= 0.24',
]

Expand Down

0 comments on commit 988b886

Please sign in to comment.