From 2a2da56a0e9a14ca4c3ab71e8f4b4436d8308fc1 Mon Sep 17 00:00:00 2001 From: Vukas Pajic <83825269+vulevukusej@users.noreply.github.com> Date: Wed, 20 Jul 2022 08:32:36 +0200 Subject: [PATCH] added test to check non standard characters --- src/ifcopenshell-python/test/util/test_selector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/test/util/test_selector.py b/src/ifcopenshell-python/test/util/test_selector.py index 37a744e6e4..2016be15cf 100644 --- a/src/ifcopenshell-python/test/util/test_selector.py +++ b/src/ifcopenshell-python/test/util/test_selector.py @@ -111,6 +111,12 @@ class TestSelector(test.bootstrap.IFC4): 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*="abc"]') == [] + + def test_selecting_a_property_which_includes_non_standard_characters(self): + element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall") + pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="a !%$§&/()?|*-+,€~#@µ^°a") + ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"a !%$§&/()?|*-+,€~#@µ^°a": "Bar"}) + assert subject.Selector.parse(self.file, '.IfcElement[a !%$§&/()?|*-+,€~#@µ^°a.a !%$§&/()?|*-+,€~#@µ^°a="Bar"]') == [element] def test_comparing_if_value_is_in_a_list(self): element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")