sync get_base_qto after 70a4af2

This commit is contained in:
Andrej730
2024-05-28 12:05:14 +05:00
parent f27dbacd28
commit 6035683492
2 changed files with 58 additions and 7 deletions
+41 -1
View File
@@ -226,7 +226,7 @@ class TestGetBaseQto(test.bim.bootstrap.NewFile):
assert subject.get_base_qto(product).id() == pset_qto.get_info()["id"]
assert subject.get_base_qto(product).Name == pset_qto.Name
def test_isempty(self):
def test_no_quantities(self):
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
wall = ifc.createIfcWall()
@@ -235,6 +235,46 @@ class TestGetBaseQto(test.bim.bootstrap.NewFile):
product = tool.Ifc.get_entity(wall_obj)
assert not subject.get_base_qto(product) == True
def test_anomaly_named_quantities(self):
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
product = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcBuildingElementProxy")
tool.Ifc.run(
"pset.add_qto",
product=product,
name="EQto_BodyGeometryValidation",
)
tool.Ifc.run(
"pset.add_qto",
product=product,
name="Qto_BuildingElementProxyQuantities",
)
# Prioritized over Qto_BodyGeometryValidation.
base_qto_name = subject.get_base_qto(product).Name
assert base_qto_name == "Qto_BuildingElementProxyQuantities"
# Ensure methods are in sync.
assert base_qto_name == subject.get_applicable_base_quantity_name(product)
def test_prioritize_base_over_other_qto(self):
ifc = ifcopenshell.file(schema="IFC4X3")
tool.Ifc.set(ifc)
product = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall")
tool.Ifc.run(
"pset.add_qto",
product=product,
name="Qto_BodyGeometryValidation",
)
tool.Ifc.run(
"pset.add_qto",
product=product,
name="Qto_WallBaseQuantities",
)
# Prioritized over Qto_BodyGeometryValidation.
base_qto_name = subject.get_base_qto(product).Name
assert base_qto_name == "Qto_WallBaseQuantities"
# Ensure methods are in sync.
assert base_qto_name == subject.get_applicable_base_quantity_name(product)
class TestGetRelatedCostItemQuantities(test.bim.bootstrap.NewFile):
def test_run(self):