summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:06:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:06:10 +0000
commit850d2f95de58c61926e7aa9eed5c26d3954f6095 (patch)
treebe44ba77f197e04a5e813c1624952b7b38c6f186 /tests
parentAdding upstream version 3.2.0. (diff)
downloadcfgv-850d2f95de58c61926e7aa9eed5c26d3954f6095.tar.xz
cfgv-850d2f95de58c61926e7aa9eed5c26d3954f6095.zip
Adding upstream version 3.3.0.upstream/3.3.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/cfgv_test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/cfgv_test.py b/tests/cfgv_test.py
index 7320e4c..15bf581 100644
--- a/tests/cfgv_test.py
+++ b/tests/cfgv_test.py
@@ -529,7 +529,15 @@ class Error(Exception):
def test_load_from_filename_file_does_not_exist():
with pytest.raises(Error) as excinfo:
load_from_filename('does_not_exist', map_required, json.loads, Error)
- assert excinfo.value.args[0].error_msg == 'does_not_exist does not exist'
+ assert excinfo.value.args[0].error_msg == 'does_not_exist is not a file'
+
+
+def test_load_from_filename_not_a_file(tmpdir):
+ with tmpdir.as_cwd():
+ tmpdir.join('f').ensure_dir()
+ with pytest.raises(Error) as excinfo:
+ load_from_filename('f', map_required, json.loads, Error)
+ assert excinfo.value.args[0].error_msg == 'f is not a file'
def test_load_from_filename_unicode_error(tmp_path):