Skip to content

Commit

Permalink
Implement unittest to test for bug spotted by @bassosimone
Browse files Browse the repository at this point in the history
* Fix bug in serializing of JSON
  • Loading branch information
hellais committed Mar 21, 2016
1 parent cb718ad commit 4843573
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ooni/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def serializeEntry(self, entry, serialisation_format="yaml"):
'input': entry.pop('input', None),
'id': str(uuid.uuid4()),
'test_start_time': entry.pop('test_start_time', None),
'measurement_start_time': entry.testInstance.report.pop('measurement_start_time', None),
'measurement_start_time': entry.pop('measurement_start_time', None),
'test_runtime': entry.pop('test_runtime', None),
'test_keys': entry
}
Expand Down
3 changes: 2 additions & 1 deletion ooni/tests/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class MockTest(object):

oonib_new_report_message = {
'report_id': "20140129T202038Z_AS0_" + "A" * 50,
'backend_version': "1.0"
'backend_version': "1.0",
'supported_formats': ["yaml", "json"]
}

oonib_generic_error_message = {
Expand Down

0 comments on commit 4843573

Please sign in to comment.