Skip to content

Commit

Permalink
fix that it concerns gpkg in iliGpkg mode as well
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Oct 28, 2024
1 parent cdbb212 commit f548944
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modelbaker/iliwrapper/ili2dbconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def to_ili2db_args(self, extra_args=[], with_action=True):
elif self.db_ili_version is None or self.db_ili_version > 3:
self.append_args(args, ["--strokeArcs=False"])

if self.tool == DbIliMode.gpkg:
if self.tool & DbIliMode.gpkg:
if self.create_gpkg_multigeom:
self.append_args(args, ["--gpkgMultiGeomPerTable"], True)
elif self.db_ili_version is None or self.db_ili_version > 3:
Expand Down
11 changes: 6 additions & 5 deletions tests/test_multiple_geom_gpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_multiple_geom_geopackage(self):
Checks when the gdal version is sufficient (means >=3.4) if tables are created with multiple geometries and the correct layers are generated.
This of course depends with what gdal version the current images are built.
"""
sufficient_gdal = self._sufficient_gdal()

importer = iliimporter.Importer()
importer.tool = DbIliMode.ili2gpkg
Expand All @@ -67,7 +66,7 @@ def test_multiple_geom_geopackage(self):
importer.configuration.create_basket_col = True

# create it when there's a sufficient gdal version
importer.configuration.create_gpkg_multigeom = True
importer.configuration.create_gpkg_multigeom = self._sufficient_gdal()

importer.stdout.connect(self.print_info)
importer.stderr.connect(self.print_error)
Expand All @@ -78,9 +77,11 @@ def test_multiple_geom_geopackage(self):
db_connector = db_utils.get_db_connector(importer.configuration)
tables_with_multiple_geometries = db_connector.multiple_geometry_tables()

bool(len(tables_with_multiple_geometries) > 0)

# should have multiple when having a sufficient gdal and otherwise not
if sufficient_gdal:
assert len(tables_with_multiple_geometries) == 1
if self._sufficient_gdal():
assert len(tables_with_multiple_geometries) > 0
else:
assert len(tables_with_multiple_geometries) == 0

Expand Down Expand Up @@ -135,7 +136,7 @@ def test_multiple_geom_geopackage(self):
"T_ILI2DB_DATASET",
}

if sufficient_gdal:
if self._sufficient_gdal():
assert {
layer.name() for layer in tree_layers
} == expected_layer_names_with_multigeometry
Expand Down

0 comments on commit f548944

Please sign in to comment.