mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix tests missing assert statement - add assert and fix them
This commit is contained in:
@@ -682,6 +682,7 @@ class Drawing(bonsai.core.tool.Drawing):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def generate_sheet_identification(cls) -> str:
|
def generate_sheet_identification(cls) -> str:
|
||||||
number = len([d for d in tool.Ifc.get().by_type("IfcDocumentInformation") if d.Scope == "SHEET"])
|
number = len([d for d in tool.Ifc.get().by_type("IfcDocumentInformation") if d.Scope == "SHEET"])
|
||||||
|
number += 1
|
||||||
return "A" + str(number).zfill(2)
|
return "A" + str(number).zfill(2)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -478,9 +478,9 @@ class TestGenerateSheetIdentification(NewFile):
|
|||||||
def test_run(self):
|
def test_run(self):
|
||||||
ifc = ifcopenshell.file()
|
ifc = ifcopenshell.file()
|
||||||
tool.Ifc.set(ifc)
|
tool.Ifc.set(ifc)
|
||||||
subject.generate_sheet_identification() == "A01"
|
assert subject.generate_sheet_identification() == "A01"
|
||||||
document = ifc.createIfcDocumentInformation()
|
document = ifc.createIfcDocumentInformation()
|
||||||
subject.generate_sheet_identification() == "A02"
|
assert subject.generate_sheet_identification() == "A02"
|
||||||
|
|
||||||
|
|
||||||
class TestGetTextLiteral(NewFile):
|
class TestGetTextLiteral(NewFile):
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ class TestGetPorts(NewFile):
|
|||||||
element = ifc.createIfcDuctSegment()
|
element = ifc.createIfcDuctSegment()
|
||||||
port = ifc.createIfcDistributionPort()
|
port = ifc.createIfcDistributionPort()
|
||||||
ifcopenshell.api.run("system.assign_port", ifc, element=element, port=port)
|
ifcopenshell.api.run("system.assign_port", ifc, element=element, port=port)
|
||||||
subject.get_ports(element) == [port]
|
assert subject.get_ports(element) == [port]
|
||||||
|
|
||||||
|
|
||||||
class TestImportSystemAttributes(NewFile):
|
class TestImportSystemAttributes(NewFile):
|
||||||
|
|||||||
Reference in New Issue
Block a user