summaryrefslogtreecommitdiffstats
path: root/tests/cfgv_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-08-08 18:26:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-08-08 18:26:57 +0000
commitc0d15f54edaf76cfac31fb725cb3d43d00a14724 (patch)
treea12380ee8bfa8b1688d14c127accb178121f8b9d /tests/cfgv_test.py
parentReleasing debian version 3.1.0-2. (diff)
downloadcfgv-c0d15f54edaf76cfac31fb725cb3d43d00a14724.tar.xz
cfgv-c0d15f54edaf76cfac31fb725cb3d43d00a14724.zip
Merging upstream version 3.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/cfgv_test.py')
-rw-r--r--tests/cfgv_test.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/cfgv_test.py b/tests/cfgv_test.py
index 1b143a6..7320e4c 100644
--- a/tests/cfgv_test.py
+++ b/tests/cfgv_test.py
@@ -532,6 +532,16 @@ def test_load_from_filename_file_does_not_exist():
assert excinfo.value.args[0].error_msg == 'does_not_exist does not exist'
+def test_load_from_filename_unicode_error(tmp_path):
+ f = tmp_path.joinpath('f')
+ f.write_bytes(b'\x98\xae\xfe')
+
+ with pytest.raises(Error) as excinfo:
+ load_from_filename(f, map_required, json.loads, Error)
+ expected = (f'File {f}', mock.ANY)
+ _assert_exception_trace(excinfo.value.args[0], expected)
+
+
def test_load_from_filename_fails_load_strategy(tmpdir):
f = tmpdir.join('foo.notjson')
f.write('totes not json')