MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / assert_type

Function assert_type

src/ifcbimtester/bimtester/util.py:61–69  ·  view source on GitHub ↗
(element, ifc_class, is_exact=False)

Source from the content-addressed store, hash-verified

59
60
61def assert_type(element, ifc_class, is_exact=False):
62 if is_exact:
63 assert element.is_a() == ifc_class, _("The element {} is an {} instead of {}.").format(
64 element, element.is_a(), ifc_class
65 )
66 else:
67 assert element.is_a(ifc_class), _("The element {} is an {} instead of {}.").format(
68 element, element.is_a(), ifc_class
69 )
70
71
72def assert_attribute(element, name, value=None):

Callers 1

ifcopenshell_open_testFunction · 0.85

Calls 3

_Function · 0.90
formatMethod · 0.80
is_aMethod · 0.45

Tested by 1

ifcopenshell_open_testFunction · 0.68