def test_decode(): prefix, obj = subjson.loads('hello~~~{"a": 1, "b": 2}') assert prefix == 'hello' assert obj == dict(a=1, b=2)
def test_decode_multiple_separators(): prefix, obj = subjson.loads('hello~~~{"a": 1, "b": "~~~"}') assert prefix == 'hello' assert obj == dict(a=1, b='~~~')
def test_decode_no_json(): subjson.loads('{"a": 1, "b": 2}')
def test_decode(): prefix, obj = subjson.loads('hello~~~{"a": 1, "b": 2}') assert prefix == 'hello' assert obj == dict(a=1,b=2)
def test_decode_multiple_separators(): prefix, obj = subjson.loads('hello~~~{"a": 1, "b": "~~~"}') assert prefix == 'hello' assert obj == dict(a=1,b='~~~')