tests: test_import_non_json_string added.

This commit is contained in:
Fabian Joswig 2022-07-04 16:59:24 +01:00
parent 54789f7fe6
commit 504a8f3486

View file

@ -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",