From 504a8f34869cc20d899e02e5e90a730f99f79900 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 4 Jul 2022 16:59:24 +0100 Subject: [PATCH] tests: test_import_non_json_string added. --- tests/json_io_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/json_io_test.py b/tests/json_io_test.py index 5474c8ce..b161ea5c 100644 --- a/tests/json_io_test.py +++ b/tests/json_io_test.py @@ -1,5 +1,6 @@ import os import gzip +import rapidjson import numpy as np import pyerrors as pe import pyerrors.input.json as jsonio @@ -378,6 +379,11 @@ def test_reconstruct_non_linear_r_obs_list(tmp_path): assert assert_equal_Obs(oa, ob) +def test_import_non_json_string(): + with pytest.raises(rapidjson.JSONDecodeError): + pe.input.json.import_json_string("this is garbage") + + def assert_equal_Obs(to, ro): for kw in ["N", "cov_names", "covobs", "ddvalue", "dvalue", "e_content", "e_names", "idl", "mc_names", "names",