diff --git a/unittests/data/list_in_value.xml b/unittests/data/list_in_value.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3627cad313827e42350575ec3a297e281107211 --- /dev/null +++ b/unittests/data/list_in_value.xml @@ -0,0 +1,10 @@ +<Record id="1002" description="A description of this example experiment."> + <Version id="945c6858819d2609a5475ee4df64571984acd039" head="true"> + <Predecessor id="0df3cfe164fbafe9777f9356d0be2403890c54cd" /> + </Version> + <Parent id="1001" name="Experiment" /> + <Property datatype="SomeRecordType" id="1003" name="DepthTest" importance="FIX"> + <Value>1004</Value> + <Value>1005</Value> + </Property> +</Record> diff --git a/unittests/test_issues.py b/unittests/test_issues.py new file mode 100644 index 0000000000000000000000000000000000000000..84573c7917e87cbc33364f13a2d22c34a563bfb7 --- /dev/null +++ b/unittests/test_issues.py @@ -0,0 +1,33 @@ +# This file is a part of the CaosDB Project. +# +# Copyright (c) 2022 IndiScale GmbH +# Copyright (c) 2022 Daniel Hornung (d.hornung@indiscale.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +"""Test known issues to prevent regressions. +""" + +import os + +import lxml +import caosdb as db + + +def test_issue_100(): + """_parse_value() fails for some list-valued content + """ + filename = os.path.join(os.path.dirname(__file__), "data", "list_in_value.xml") + xml_el = lxml.etree.parse(filename).getroot() + rec = db.common.models._parse_single_xml_element(xml_el)