Skip to content
Snippets Groups Projects
Commit bd830295 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TST: Extend to/from_xml consistency checks

parent 4328bc6a
No related branches found
No related tags found
1 merge request!82Add test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/89
Pipeline #57997 passed
...@@ -78,7 +78,8 @@ def test_gitlab_com_89(): ...@@ -78,7 +78,8 @@ def test_gitlab_com_89():
https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/81 https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/81
""" """
# We need a container generated with data from the server # We need a container generated with data from the server
db.RecordType(name="TestType").insert() rt = db.RecordType(name="TestType")
rt.insert()
container = db.execute_query("FIND RECORDTYPE *") container = db.execute_query("FIND RECORDTYPE *")
# With this container, to_xml, xml2str, and from_xml should not generate # With this container, to_xml, xml2str, and from_xml should not generate
...@@ -86,7 +87,9 @@ def test_gitlab_com_89(): ...@@ -86,7 +87,9 @@ def test_gitlab_com_89():
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter("error") warnings.simplefilter("error")
xml_str = linkahead.common.utils.xml2str(container.to_xml()) xml_str = linkahead.common.utils.xml2str(container.to_xml())
db.Container.from_xml(xml_str) cont_from_xml = db.Container.from_xml(xml_str)
assert len(cont_from_xml) == len(container)
assert cont_from_xml[0].name == rt.name
# @pytest.mark.xfail(reason="Entities with many, long, properties: " # @pytest.mark.xfail(reason="Entities with many, long, properties: "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment