commit 370fbfbb5485edb060b159fa3517737133806a87 Author: Arturo Filastò arturo@filasto.net Date: Thu Mar 17 15:57:23 2016 +0100
Fix unittests to use test_start_time --- oonib/report/handlers.py | 2 +- oonib/test/test_report.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/oonib/report/handlers.py b/oonib/report/handlers.py index 56fe20b..1e1d2ba 100644 --- a/oonib/report/handlers.py +++ b/oonib/report/handlers.py @@ -311,7 +311,7 @@ class NewReportHandlerFile(ReportHandler, UpdateReportMixin): 'test_name': self.testName, 'test_version': self.testVersion, 'input_hashes': report_data.get('input_hashes', []), - 'test_start_time': report_data['test_start_time'], + 'test_start_time': str(report_data['test_start_time']), 'data_format_version': str(report_data.get('data_format_version', '0.1.0')) } data = "---\n" + yaml.dump(content) + "...\n" diff --git a/oonib/test/test_report.py b/oonib/test/test_report.py index 63865ae..5957250 100644 --- a/oonib/test/test_report.py +++ b/oonib/test/test_report.py @@ -41,7 +41,7 @@ sample_report_entry = { 'probe_ip': '127.0.0.1', 'software_name': 'ooniprobe', 'software_version': '1.1.0', - 'start_time': 0, + 'test_start_time': '2016-01-01 12:34:56', 'test_name': 'fake_test', 'test_version': '0.1.0' } @@ -59,7 +59,7 @@ probe_city: null probe_ip: 127.0.0.1 software_name: ooniprobe software_version: 1.1.0 -start_time: 0 +test_start_time: '2016-01-01 12:34:56' test_name: fake_test test_version: 0.1.0 ... @@ -72,7 +72,7 @@ dummy_data = { 'test_version': '0.1', 'probe_asn': 'AS0', 'probe_cc': 'ZZ', - 'start_time': time.time() + 'test_start_time': '2016-01-01 12:34:56' }
for _, handler in reportAPI:
tor-commits@lists.torproject.org