From 5300f4c78fefae204b57bb17c92b091249941c8e Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 28 Jan 2025 10:54:37 +1100 Subject: [PATCH] Fix failing tests --- .../ifcopenshell/geom/main.py | 68 +++++++++---------- .../test/api/unit/test_remove_unit.py | 4 +- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 08f443c6b9..1f9215cb5c 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -62,50 +62,50 @@ if has_occ: SETTING = Literal[ - "mesher-linear-deflection", - "mesher-angular-deflection", - "reorient-shells", - "length-unit", "angle-unit", - "precision", - "dimensionality", - "layerset-first", - "disable-boolean-result", - "no-wire-intersection-check", - "no-wire-intersection-tolerance", - "precision-factor", - "debug-boolean", + "apply-default-materials", "boolean-attempt-2d", - "weld-vertices", - "use-world-coords", - "unify-shapes", - "use-material-names", - "convert-back-units", + "building-local-placement", + "circle-segments", + "context-identifiers", "context-ids", "context-types", - "context-identifiers", - "iterator-output", + "convert-back-units", + "debug", + "dimensionality", + "disable-boolean-result", "disable-opening-subtractions", - "apply-default-materials", - "no-normals", - "generate-uvs", - "enable-layerset-slicing", - "element-hierarchy", - "validate", "edge-arrows", - "building-local-placement", - "site-local-placement", + "element-hierarchy", + "enable-layerset-slicing", "force-space-transparency", - "circle-segments", + "function-step-param", + "function-step-type", + "generate-uvs", + "iterator-output", "keep-bounding-boxes", - "piecewise-step-type", - "piecewise-step-param", - "use-python-opencascade", - "no-parallel-mapping", - "triangulation-type", - "model-rotation", + "layerset-first", + "length-unit", + "mesher-angular-deflection", + "mesher-linear-deflection", "model-offset", + "model-rotation", + "no-normals", + "no-parallel-mapping", + "no-wire-intersection-check", + "no-wire-intersection-tolerance", + "precision", + "precision-factor", + "reorient-shells", + "site-local-placement", "surface-colour", + "triangulation-type", + "unify-shapes", + "use-material-names", + "use-python-opencascade", + "use-world-coords", + "validate", + "weld-vertices", ] SERIALIZER_SETTING = Literal[ "base-uri", diff --git a/src/ifcopenshell-python/test/api/unit/test_remove_unit.py b/src/ifcopenshell-python/test/api/unit/test_remove_unit.py index ef6732259a..5b3ab7bcc4 100644 --- a/src/ifcopenshell-python/test/api/unit/test_remove_unit.py +++ b/src/ifcopenshell-python/test/api/unit/test_remove_unit.py @@ -22,6 +22,7 @@ import ifcopenshell.api.unit class TestRemoveUnit(test.bootstrap.IFC4): def test_remove_a_single_unit(self): + self.file.createIfcProject() unit = self.file.createIfcContextDependentUnit() ifcopenshell.api.unit.remove_unit(self.file, unit=unit) assert len(self.file.by_type("IfcContextDependentUnit")) == 0 @@ -44,9 +45,10 @@ class TestRemoveUnit(test.bootstrap.IFC4): assert assignment.Units == (unit2,) def test_removing_a_unit_deeply(self): + self.file.createIfcProject() unit = ifcopenshell.api.unit.add_conversion_based_unit(self.file, name="foot") ifcopenshell.api.unit.remove_unit(self.file, unit=unit) - assert len([e for e in self.file]) == 0 + assert len([e for e in self.file]) == 1 class TestRemoveUnitIFC2X3(test.bootstrap.IFC2X3, TestRemoveUnit):