From 44eb46ec5975b615191f135d5093269e78c43788 Mon Sep 17 00:00:00 2001
From: Alexander Schlemmer <a.schlemmer@indiscale.com>
Date: Thu, 13 Feb 2025 15:35:31 +0100
Subject: [PATCH] TST: fixed test for description

---
 unittests/eln_cfood.yaml            | 11 +++++++++--
 unittests/test_rocrate_converter.py |  6 ------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/unittests/eln_cfood.yaml b/unittests/eln_cfood.yaml
index ab8e7108..bb29b7da 100644
--- a/unittests/eln_cfood.yaml
+++ b/unittests/eln_cfood.yaml
@@ -26,11 +26,18 @@ DataDir:
             "@id": records-example/$
             name: (?P<name>.*)
             keywords: (?P<keywords>.*)
-            description: (?P<description>.*)
             dateModified: (?P<dateModified>.*)
           records:
             Dataset:
               name: $name
               keywords: $keywords
-              description: $description
               dateModified: $dateModified
+          subtree:
+            Description:
+              type: ROCrateEntity
+              match_type: TextObject
+              match_properties:
+                text: (?P<description>.*)
+              records:
+                Dataset:
+                  description: $description
diff --git a/unittests/test_rocrate_converter.py b/unittests/test_rocrate_converter.py
index 02f0f602..4b6bde17 100644
--- a/unittests/test_rocrate_converter.py
+++ b/unittests/test_rocrate_converter.py
@@ -213,12 +213,6 @@ def test_scanner():
     assert rlist[0].get_property("dateModified").value == "2024-08-21T11:43:17.626965+00:00"
 
 
-@pytest.mark.xfail(
-    reason="The description is no longer a simple string, but a reference to another record."
-    "The rocrate converter will be able to dereference this as soon as this feature is implemented:"
-    "https://gitlab.indiscale.com/caosdb/src/caosdb-crawler/-/issues/191"
-    "This test might need changes in the yaml definition."
-)
 def test_description_reference():
     rlist = scanner.scan_directory(os.path.join(UNITTESTDIR, "eln_files/"),
                                    os.path.join(UNITTESTDIR, "eln_cfood.yaml"))
-- 
GitLab