mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 21:53:40 +00:00
test_append_asset - fix skipped test
It wasn't appending library_material so test would never fail
This commit is contained in:
@@ -660,10 +660,10 @@ class TestAppendAssetIFC4(test.bootstrap.IFC4, TestAppendAssetIFC2X3):
|
|||||||
library_profile = ifcopenshell.api.profile.add_parameterized_profile(library, "IfcCircleProfileDef")
|
library_profile = ifcopenshell.api.profile.add_parameterized_profile(library, "IfcCircleProfileDef")
|
||||||
library_profile.ProfileName = "TestProfile"
|
library_profile.ProfileName = "TestProfile"
|
||||||
material_set = ifcopenshell.api.material.add_material_set(library, set_type="IfcMaterialProfileSet")
|
material_set = ifcopenshell.api.material.add_material_set(library, set_type="IfcMaterialProfileSet")
|
||||||
material = ifcopenshell.api.material.add_material(library, "TestMaterial")
|
library_material = ifcopenshell.api.material.add_material(library, "TestMaterial")
|
||||||
style = ifcopenshell.api.style.add_style(library, "TestStyle", ifc_class="IfcSurfaceStyle")
|
library_style = ifcopenshell.api.style.add_style(library, "TestStyle", ifc_class="IfcSurfaceStyle")
|
||||||
ifcopenshell.api.style.assign_material_style(library, material, style, body)
|
ifcopenshell.api.style.assign_material_style(library, library_material, library_style, body)
|
||||||
ifcopenshell.api.material.add_profile(library, material_set, material, library_profile)
|
ifcopenshell.api.material.add_profile(library, material_set, library_material, library_profile)
|
||||||
ifcopenshell.api.material.assign_material(
|
ifcopenshell.api.material.assign_material(
|
||||||
library, [column_type], material=material_set, type="IfcMaterialProfileSet"
|
library, [column_type], material=material_set, type="IfcMaterialProfileSet"
|
||||||
)
|
)
|
||||||
@@ -677,14 +677,14 @@ class TestAppendAssetIFC4(test.bootstrap.IFC4, TestAppendAssetIFC2X3):
|
|||||||
assert len(profiles) == 1 and profiles[0].ProfileName == "TestProfile"
|
assert len(profiles) == 1 and profiles[0].ProfileName == "TestProfile"
|
||||||
|
|
||||||
# Test adding a material with existing name.
|
# Test adding a material with existing name.
|
||||||
material = ifcopenshell.api.material.add_material(self.file, "TestMaterial")
|
ifcopenshell.api.material.add_material(self.file, "TestMaterial")
|
||||||
ifcopenshell.api.project.append_asset(self.file, library, library_profile)
|
ifcopenshell.api.project.append_asset(self.file, library, library_material)
|
||||||
materials = self.file.by_type("IfcMaterial")
|
materials = self.file.by_type("IfcMaterial")
|
||||||
assert len(materials) == 1 and materials[0].Name == "TestMaterial"
|
assert len(materials) == 1 and materials[0].Name == "TestMaterial"
|
||||||
|
|
||||||
# Test adding a style with existing name.
|
# Test adding a style with existing name.
|
||||||
style = ifcopenshell.api.style.add_style(self.file, "TestStyle", ifc_class="IfcSurfaceStyle")
|
ifcopenshell.api.style.add_style(self.file, "TestStyle", ifc_class="IfcSurfaceStyle")
|
||||||
ifcopenshell.api.project.append_asset(self.file, library, style)
|
ifcopenshell.api.project.append_asset(self.file, library, library_style)
|
||||||
styles = self.file.by_type("IfcSurfaceStyle")
|
styles = self.file.by_type("IfcSurfaceStyle")
|
||||||
assert len(styles) == 1 and styles[0].Name == "TestStyle"
|
assert len(styles) == 1 and styles[0].Name == "TestStyle"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user