def jdump(obj, **kwargs):
    """JSON dump utility."""
    print(json_reload(obj, **kwargs))
예제 #2
0
 def test_re_load_error_true(self):
     """Simple test."""
     x = "{"
     with pytest.raises(Exception):
         json_reload(obj=x, error=True)
예제 #3
0
 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'
예제 #4
0
 def test_re_load_error_false(self):
     """Simple test."""
     x = "{"
     y = json_reload(obj=x, error=False)
     assert y == x
예제 #5
0
 def test_re_load(self):
     """Simple test."""
     x = '{"x": 2}'
     y = json_reload(obj=x)
     assert y == '{\n  "x": 2\n}'