mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix IFCTester handling of falsey properties
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.PHONY: test
|
||||
test:
|
||||
pytest -p no:pytest-blender test
|
||||
@@ -366,7 +366,7 @@ class Property(Facet):
|
||||
props[pset_name] = {}
|
||||
if isinstance(self.name, str):
|
||||
prop = pset_props.get(self.name)
|
||||
if prop:
|
||||
if prop is not None and prop != "":
|
||||
props[pset_name][self.name] = prop
|
||||
else:
|
||||
props[pset_name] = {k: v for k, v in pset_props.items() if k == self.name}
|
||||
|
||||
@@ -840,6 +840,10 @@ class TestProperty:
|
||||
run("", facet=facet, inst=element, expected=False)
|
||||
ifcopenshell.api.run("pset.edit_pset", ifc, pset=pset, properties={"Foo": "Bar"})
|
||||
run("", facet=facet, inst=element, expected=True)
|
||||
ifcopenshell.api.run("pset.edit_pset", ifc, pset=pset, properties={"Foo": ifc.createIfcBoolean(True)})
|
||||
run("", facet=facet, inst=element, expected=True)
|
||||
ifcopenshell.api.run("pset.edit_pset", ifc, pset=pset, properties={"Foo": False})
|
||||
run("", facet=facet, inst=element, expected=True)
|
||||
|
||||
# A simple value checks an exact case-sensitive match
|
||||
facet = Property(propertySet="Foo_Bar", name="Foo", value="Bar")
|
||||
|
||||
@@ -460,8 +460,8 @@ class IDSFacet extends HTMLElement {
|
||||
|
||||
var name = this.idsElement.getElementsByTagNameNS(ns, 'name')[0];
|
||||
var value = this.getIdsValue(name);
|
||||
if (value.type == 'simpleValue') {
|
||||
var content = this.capitalise(value.content.toLowerCase().replace('ifc', ''))
|
||||
if (value.type == 'simpleValue' || value.type == 'enumeration') {
|
||||
var content = this.capitalise(value.content.toLowerCase().replaceAll('ifc', ''))
|
||||
parameters.name = '<ids-param filter="entityName">' + content + '</ids-param>';
|
||||
this.params.push(value.param);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user