def jdump(obj, **kwargs): """JSON dump utility.""" print(json_reload(obj, **kwargs))
def test_re_load_error_true(self): """Simple test.""" x = "{" with pytest.raises(Exception): json_reload(obj=x, error=True)
def test_re_load_trim(self): """Simple test.""" x = '{{"x": {}}}'.format("a" * 50) y = json_reload(obj=x, trim=20) assert y == '{"x": aaaaaaaaaaaaaa\nTrimmed over 20 characters'
def test_re_load_error_false(self): """Simple test.""" x = "{" y = json_reload(obj=x, error=False) assert y == x
def test_re_load(self): """Simple test.""" x = '{"x": 2}' y = json_reload(obj=x) assert y == '{\n "x": 2\n}'