[tor-commits] [ooni-probe/master] Check to see if setUp was already called correctly

art at torproject.org art at torproject.org
Tue Oct 29 15:52:16 UTC 2013


commit db70b529b990ec9a0399f3917e7ce4166b2265da
Author: aagbsn <aagbsn at extc.org>
Date:   Wed Sep 18 19:09:58 2013 +0200

    Check to see if setUp was already called correctly
    
    The report dict is already created in the constructor, so we look to see
    if instead the input argument was already set.
---
 ooni/tasks.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ooni/tasks.py b/ooni/tasks.py
index 0c7f34e..3d2dbba 100644
--- a/ooni/tasks.py
+++ b/ooni/tasks.py
@@ -108,7 +108,7 @@ class Measurement(TaskWithTimeout):
         """
         self.testInstance = test_class
         self.testInstance.input = test_input
-        if not self.testInstance.report:
+        if 'input' not in self.testInstance.report.keys():
             self.testInstance.report = {'input': test_input}
             self.testInstance._setUp()
             self.testInstance._start_time = time.time()





More information about the tor-commits mailing list