[tor-commits] [ooni-probe/master] Implement unittest to test for bug spotted by @bassosimone

art at torproject.org art at torproject.org
Fri Apr 29 09:42:25 UTC 2016


commit 48435739f1bdd6631065a8ef41e5c51605955b2a
Author: Arturo Filastò <arturo at filasto.net>
Date:   Mon Mar 21 16:54:18 2016 +0100

    Implement unittest to test for bug spotted by @bassosimone
    
    * Fix bug in serializing of JSON
---
 ooni/reporter.py            | 2 +-
 ooni/tests/test_reporter.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ooni/reporter.py b/ooni/reporter.py
index d772ae9..2ee8468 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -276,7 +276,7 @@ class OONIBReporter(OReporter):
                     '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
                 }
diff --git a/ooni/tests/test_reporter.py b/ooni/tests/test_reporter.py
index 5adb4af..94192ee 100644
--- a/ooni/tests/test_reporter.py
+++ b/ooni/tests/test_reporter.py
@@ -32,7 +32,8 @@ test_details = {
 
 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 = {





More information about the tor-commits mailing list