mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 12:07:06 +00:00
test when value does not exist
This commit is contained in:
@@ -111,6 +111,16 @@ class TestSelector(test.bootstrap.IFC4):
|
|||||||
assert subject.Selector.parse(self.file, '.IfcElement[Name*="Foo"]') == [element]
|
assert subject.Selector.parse(self.file, '.IfcElement[Name*="Foo"]') == [element]
|
||||||
assert subject.Selector.parse(self.file, '.IfcElement[Name*="oba"]') == [element]
|
assert subject.Selector.parse(self.file, '.IfcElement[Name*="oba"]') == [element]
|
||||||
assert subject.Selector.parse(self.file, '.IfcElement[Name*="abc"]') == []
|
assert subject.Selector.parse(self.file, '.IfcElement[Name*="abc"]') == []
|
||||||
|
|
||||||
|
def test_comparing_if_value_does_not_exist(self):
|
||||||
|
element_1 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||||
|
element_2 = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||||
|
pset_1 = ifcopenshell.api.run("pset.add_pset", self.file, product=element_1, name="Foo_Bar")
|
||||||
|
pset_2 = ifcopenshell.api.run("pset.add_pset", self.file, product=element_2, name="Foo_Bar")
|
||||||
|
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset_1, properties={"Foo": "Bar"})
|
||||||
|
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset_2, properties={"Foo": "BOO"})
|
||||||
|
assert subject.Selector.parse(self.file, '.IfcElement[Foo_Bar.Foo != "Bar"]') == [element_2]
|
||||||
|
assert subject.Selector.parse(self.file, '.IfcElement[Foo_Bar.Foo != "BOO"]') == [element_1]
|
||||||
|
|
||||||
def test_selecting_a_property_which_includes_non_standard_characters(self):
|
def test_selecting_a_property_which_includes_non_standard_characters(self):
|
||||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||||
|
|||||||
Reference in New Issue
Block a user