From 68b91790588ac311da6b773d3326e2abb8c4be8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Mon, 27 Feb 2023 10:41:12 +0100
Subject: [PATCH] TST: add test for remove_prefix with bad value

---
 CHANGELOG.md           |  6 +++---
 unittests/test_tool.py | 11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index fda4a75e..5abcafd4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,11 +28,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Deprecated ###
 
-- The command line argument ``--prefix`` and the ``prefix`` argument of
-  `crawler_main` is deprecated. Use the new argument ``--remove-prefix``
-  instead.
+- The ``prefix`` argument of `crawler_main` is deprecated. Use the new argument
+  ``remove_prefix`` instead.
 
 ### Removed ###
+- The command line argument ``--prefix``. Use the new argument ``--remove-prefix`` instead.
 
 ### Fixed ###
 
diff --git a/unittests/test_tool.py b/unittests/test_tool.py
index af84f8fd..afb12a6b 100755
--- a/unittests/test_tool.py
+++ b/unittests/test_tool.py
@@ -982,3 +982,14 @@ def test_deprecated_prefix_option():
                      remove_prefix="to/be/removed")
 
     assert "(deprecated) `prefix` and the `remove_prefix`" in str(ve.value)
+
+
+def test_wrong_remove_prefix_option():
+    """Test that calling the crawler's main function with `remove_prefix` option
+    with a bad value raises the correct error.
+    """
+
+    with raises(RuntimeError) as ve:
+        crawler_main(rfp("test_directories", "examples_article"),
+                     rfp("scifolder_extended.yml"),
+                     remove_prefix="to/be/removed")
-- 
GitLab