From 4de47f4ab588e3367369918075d9d0b9292d11a5 Mon Sep 17 00:00:00 2001
From: Florian Spreckelsen <f.spreckelsen@indiscale.com>
Date: Fri, 6 Dec 2024 11:28:39 +0100
Subject: [PATCH] TST: Test crawler_main return code

---
 integrationtests/test_crawler_main.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/integrationtests/test_crawler_main.py b/integrationtests/test_crawler_main.py
index 3c0ec57e..793dd6ed 100644
--- a/integrationtests/test_crawler_main.py
+++ b/integrationtests/test_crawler_main.py
@@ -78,12 +78,15 @@ def test_not_implemented_list_with_authorization(caplog, clear_database):
     dirlist = [basepath / "dir1", basepath / "dir2"]
 
     # This is not implemented yet, so check log for correct error.
-    crawler_main(
+    ret = crawler_main(
         dirlist,
         cfood_file_name=basepath / "cfood.yml",
         identifiables_definition_file=basepath / "identifiable.yml",
         securityMode=SecurityMode.RETRIEVE
     )
+    # crawler_main hides the error, but has a non-zero return code and
+    # errors in the log:
+    assert ret != 0
     err_tuples = [t for t in caplog.record_tuples if t[1] == logging.ERROR]
     assert len(err_tuples) == 1
     assert "currently implemented only for single paths, not for lists of paths" in err_tuples[0][2]
-- 
GitLab