mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Fix support for document references in IFC2X3
This commit is contained in:
@@ -33,3 +33,18 @@ class TestAddReference(test.bootstrap.IFC4):
|
||||
assert element.is_a("IfcDocumentReference")
|
||||
assert len(self.file.by_type("IfcDocumentReference")) == 1
|
||||
assert element.ReferencedDocument == information
|
||||
|
||||
|
||||
class TestAddReferenceIFC2X3(test.bootstrap.IFC2X3):
|
||||
def test_adding_a_reference(self):
|
||||
element = ifcopenshell.api.run("document.add_reference", self.file, information=None)
|
||||
assert element.is_a("IfcDocumentReference")
|
||||
assert len(self.file.by_type("IfcDocumentReference")) == 1
|
||||
|
||||
def test_adding_a_reference_to_an_information(self):
|
||||
self.file.createIfcProject()
|
||||
information = ifcopenshell.api.run("document.add_information", self.file, parent=None)
|
||||
element = ifcopenshell.api.run("document.add_reference", self.file, information=information)
|
||||
assert element.is_a("IfcDocumentReference")
|
||||
assert len(self.file.by_type("IfcDocumentReference")) == 1
|
||||
assert element.ReferenceToDocument[0] == information
|
||||
|
||||
Reference in New Issue
Block a user