Fix IDS namespace bug that prevented XML encoding, simplify XML writing, and new to_string() method to decrease dependency on the filesystem

This commit is contained in:
Dion Moult
2022-05-10 16:22:12 +10:00
parent 3f15dd71b1
commit 12e7ed356c
2 changed files with 24 additions and 38 deletions
+8 -1
View File
@@ -95,11 +95,18 @@ class TestIdsParsing(unittest.TestCase):
def test_parsed_ids_to_xml(self):
IDS_URL = os.path.join(os.path.dirname(__file__), "Sample-BIM-Files", "IDS", "IDS_Wall_needs_all_fields.xml")
ids_file = ids.ids.open(IDS_URL)
fn = "TEST_FILE.xml"
fn = "output.xml"
result = ids_file.to_xml(fn)
assert os.path.isfile(fn)
os.remove(fn)
self.assertTrue(result)
def test_parsed_ids_to_string(self):
IDS_URL = os.path.join(os.path.dirname(__file__), "Sample-BIM-Files", "IDS", "IDS_Wall_needs_all_fields.xml")
ids_file = ids.ids.open(IDS_URL)
output = ids_file.to_string()
assert output and "http://standards.buildingsmart.org/IDS" in output
""" Parsing IDS files with restrictions """
def test_parse_restrictions_enumeration(self):