Converting brickschema projects to IFC libraries now works on IFC2X3

This commit is contained in:
Dion Moult
2021-11-29 20:19:58 +11:00
parent 622ff05247
commit 825ffe03b0
5 changed files with 20 additions and 4 deletions
+7
View File
@@ -70,12 +70,19 @@ class TestConvertBrickProject:
def test_run(self, ifc, brick):
brick.get_brick_path_name().should_be_called().will_return("foo.ttl")
ifc.run("library.add_library", name="foo.ttl").should_be_called().will_return("library")
ifc.get_schema().should_be_called().will_return("IFC4")
brick.get_brick_path().should_be_called().will_return("/path/to/foo.ttl")
ifc.run(
"library.edit_library", library="library", attributes={"Location": "/path/to/foo.ttl"}
).should_be_called()
subject.convert_brick_project(ifc, brick)
def test_not_editing_in_ifc2x3(self, ifc, brick):
brick.get_brick_path_name().should_be_called().will_return("foo.ttl")
ifc.run("library.add_library", name="foo.ttl").should_be_called().will_return("library")
ifc.get_schema().should_be_called().will_return("IFC2X3")
subject.convert_brick_project(ifc, brick)
class TestAssignBrickReference:
def test_assigning_to_a_new_reference(self, ifc, brick):
+4
View File
@@ -63,6 +63,10 @@ class TestExportBrickAttributes(NewFile):
def test_run(self):
assert subject.export_brick_attributes("ex:#floor") == {"Identification": "ex:#floor", "Name": "floor"}
def test_run_ifc2x3(self):
tool.Ifc.set(ifcopenshell.file(schema="IFC2X3"))
assert subject.export_brick_attributes("ex:#floor") == {"ItemReference": "ex:#floor", "Name": "floor"}
class TestGetBrickPath(NewFile):
def test_run(self):