From 2a9603648e154bc75a351f02d49baa2cac0e20a8 Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Thu, 3 Mar 2022 16:02:38 +0100
Subject: [PATCH] TEST: Failing test for issue 100

For #100 models.py::_parse_value fails for some list-valued content
---
 unittests/data/list_in_value.xml | 10 ++++++++++
 unittests/test_issues.py         | 33 ++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 unittests/data/list_in_value.xml
 create mode 100644 unittests/test_issues.py

diff --git a/unittests/data/list_in_value.xml b/unittests/data/list_in_value.xml
new file mode 100644
index 00000000..c3627cad
--- /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 00000000..84573c79
--- /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)
-- 
GitLab