[lang-ref] ( dump_json ) ( python )
def test_dump_json():
import json
expected = '''\
{
"name": "test",
"lines": [
"val1",
"val2",
"val3"
]
}\
'''
json_object = {
"name": "test",
"lines": ["val1", "val2", "val3"]
}
json_string = json.dumps(json_object, indent=2)
assert json_string == expected