Fix new sheets having non-unique identification

It was checking for the wrong scope "DOCUMENTATION".
Scope "DOCUMENTATION" was left from the old times, now we use scope "SHEET".
This commit is contained in:
Andrej730
2024-09-02 16:46:50 +05:00
parent 7c542418e6
commit ccbb253d2c
2 changed files with 7 additions and 11 deletions
+4 -4
View File
@@ -220,18 +220,18 @@ class TestEnsureUniqueIdentification(NewFile):
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR"
ifc.createIfcDocumentInformation(Identification="FOOBAR", Scope="DOCUMENTATION")
ifc.createIfcDocumentInformation(Identification="FOOBAR", Scope="SHEET")
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR-X"
ifc.createIfcDocumentInformation(Identification="FOOBAR-X", Scope="DOCUMENTATION")
ifc.createIfcDocumentInformation(Identification="FOOBAR-X", Scope="SHEET")
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR-X-X"
def test_unique_document_id_ifc2x3(self):
ifc = ifcopenshell.file(schema="IFC2X3")
tool.Ifc.set(ifc)
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR"
ifc.createIfcDocumentInformation(DocumentId="FOOBAR", Scope="DOCUMENTATION")
ifc.createIfcDocumentInformation(DocumentId="FOOBAR", Scope="SHEET")
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR-X"
ifc.createIfcDocumentInformation(DocumentId="FOOBAR-X", Scope="DOCUMENTATION")
ifc.createIfcDocumentInformation(DocumentId="FOOBAR-X", Scope="SHEET")
assert subject.ensure_unique_identification("FOOBAR") == "FOOBAR-X-X"