mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Fix bug where IfcTester would pass derived attribute facets.
Now that IfcOpenShell supports derived attributes, we need to explicitly make sure the attribute facet only considers forward attributes.
This commit is contained in:
@@ -186,15 +186,21 @@ class Attribute(Facet):
|
||||
|
||||
if isinstance(self.name, str):
|
||||
names = [self.name]
|
||||
values = [getattr(inst, self.name, None)]
|
||||
attribute_type = inst.wrapped_data.get_attribute_category(self.name)
|
||||
if attribute_type == 1: # Forward attribute
|
||||
values = [getattr(inst, self.name, None)]
|
||||
else:
|
||||
values = [None]
|
||||
else:
|
||||
info = inst.get_info()
|
||||
names = []
|
||||
values = []
|
||||
for k, v in info.items():
|
||||
if k == self.name:
|
||||
names.append(k)
|
||||
values.append(v)
|
||||
attribute_type = inst.wrapped_data.get_attribute_category(k)
|
||||
if attribute_type == 1: # Forward attribute
|
||||
names.append(k)
|
||||
values.append(v)
|
||||
|
||||
is_pass = bool(values)
|
||||
reason = None
|
||||
|
||||
@@ -52,7 +52,7 @@ class TestIds:
|
||||
"@xmlns": "http://standards.buildingsmart.org/IDS",
|
||||
"@xmlns:xs": "http://www.w3.org/2001/XMLSchema",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_05.xsd",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_09.xsd",
|
||||
"info": {"title": "Untitled"},
|
||||
"specifications": {"specification": []},
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class TestIds:
|
||||
"@xmlns": "http://standards.buildingsmart.org/IDS",
|
||||
"@xmlns:xs": "http://www.w3.org/2001/XMLSchema",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_05.xsd",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_09.xsd",
|
||||
"info": {
|
||||
"title": "title",
|
||||
"copyright": "copyright",
|
||||
@@ -92,7 +92,7 @@ class TestIds:
|
||||
"@xmlns": "http://standards.buildingsmart.org/IDS",
|
||||
"@xmlns:xs": "http://www.w3.org/2001/XMLSchema",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_05.xsd",
|
||||
"@xsi:schemaLocation": "http://standards.buildingsmart.org/IDS/ids_09.xsd",
|
||||
"info": {"title": "Untitled"},
|
||||
"specifications": {"specification": []},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user