add streaming json writer for JSON output

This commit is contained in:
Sarah Hoffmann
2023-01-25 14:14:47 +01:00
parent dfcb24061e
commit 77bec1261e
6 changed files with 266 additions and 16 deletions

View File

@@ -44,7 +44,7 @@ def test_status_format_json_minimal():
result = api_impl.format_result(status, 'json')
assert result == '{"status": 700, "message": "Bad format.", "software_version": "%s"}' % (NOMINATIM_VERSION, )
assert result == '{"status":700,"message":"Bad format.","software_version":"%s"}' % (NOMINATIM_VERSION, )
def test_status_format_json_full():
@@ -54,4 +54,4 @@ def test_status_format_json_full():
result = api_impl.format_result(status, 'json')
assert result == '{"status": 0, "message": "OK", "data_updated": "2010-02-07T20:20:03+00:00", "software_version": "%s", "database_version": "5.6"}' % (NOMINATIM_VERSION, )
assert result == '{"status":0,"message":"OK","data_updated":"2010-02-07T20:20:03+00:00","software_version":"%s","database_version":"5.6"}' % (NOMINATIM_VERSION, )