[tor-commits] [ooni-probe/master] [refactoring] Change signature of NetTest() class

art at torproject.org art at torproject.org
Mon May 30 16:28:32 UTC 2016


commit f6847d42cd067a05fab5db9e149e6492f9d62fcd
Author: Arturo Filastò <arturo at filasto.net>
Date:   Tue Apr 12 17:24:41 2016 +0200

    [refactoring] Change signature of NetTest() class
---
 ooni/nettest.py            | 3 ---
 ooni/tests/test_nettest.py | 6 ++++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ooni/nettest.py b/ooni/nettest.py
index 166451a..d01b3e4 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -162,7 +162,6 @@ class NetTestLoader(object):
     collector = None
     yamloo = True
     requiresTor = False
-    reportID = None
 
     def __init__(self, options, test_file=None, test_string=None,
                  annotations={}):
@@ -497,8 +496,6 @@ class NetTest(object):
         self.testDetails = test_details
         self.testCases = test_cases
 
-        self.testInstances = []
-
         self.summary = {}
 
         # This will fire when all the measurements have been completed and
diff --git a/ooni/tests/test_nettest.py b/ooni/tests/test_nettest.py
index 1108f11..91e663f 100644
--- a/ooni/tests/test_nettest.py
+++ b/ooni/tests/test_nettest.py
@@ -263,8 +263,10 @@ class TestNetTest(unittest.TestCase):
         # XXX: if you use the same test_class twice you will have consumed all
         # of its inputs!
         tested = set([])
-        for test_instance, test_method, inputs in nt.testInstances:
-            self.assertEqual(len(list(inputs)), 10)
+        for test_class, test_method in ntl.getTestCases():
+            if test_class not in tested:
+                tested.update([test_class])
+                self.assertEqual(len(list(test_class.inputs)), 10)
 
     def test_setup_local_options_in_test_cases(self):
         ntl = NetTestLoader(dummyArgs)





More information about the tor-commits mailing list