[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Don't set requirements attribute since it's now used for another purpose.



commit 2822871edf77e97739d306cdac5031e59777160b
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Wed Apr 30 18:32:34 2014 +0200

    Don't set requirements attribute since it's now used for another purpose.
---
 ooni/nettests/blocking/dns_consistency.py |    3 +--
 ooni/oonicli.py                           |   12 ++++++------
 ooni/tests/test_oonicli.py                |   18 ++++++++++++------
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/ooni/nettests/blocking/dns_consistency.py b/ooni/nettests/blocking/dns_consistency.py
index 5d17741..9c9a5df 100644
--- a/ooni/nettests/blocking/dns_consistency.py
+++ b/ooni/nettests/blocking/dns_consistency.py
@@ -40,11 +40,10 @@ class DNSConsistencyTest(dnst.DNSTest):
     description = "Checks to see if the DNS responses from a set of DNS resolvers are consistent."
     version = "0.6"
     authors = "Arturo Filastò, Isis Lovecruft"
-    requirements = None
 
     inputFile = ['file', 'f', None,
                  'Input file of list of hostnames to attempt to resolve']
-    
+
     requiredTestHelpers = {'backend': 'dns'}
     requiresRoot = False
     requiresTor = False
diff --git a/ooni/oonicli.py b/ooni/oonicli.py
index 98c3ee6..3993b38 100644
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@ -106,16 +106,16 @@ def runWithDirector(logging=True, start_tor=True):
         config.advanced.debug = True
     if not start_tor:
         config.advanced.start_tor = False
-    
+
     if logging:
         log.start(global_options['logfile'])
-    
+
     if config.privacy.includepcap:
         try:
             checkForRoot()
         except errors.InsufficientPrivileges:
              log.err("Insufficient Privileges to capture packets."
-                     " See ooniprobe.conf privacy.includepcap") 
+                     " See ooniprobe.conf privacy.includepcap")
              sys.exit(2)
 
     director = Director()
@@ -123,12 +123,12 @@ def runWithDirector(logging=True, start_tor=True):
         print "# Installed nettests"
         for net_test_id, net_test in director.getNetTests().items():
             print "* %s (%s/%s)" % (net_test['name'],
-                                    net_test['category'], 
+                                    net_test['category'],
                                     net_test['id'])
             print "  %s" % net_test['description']
 
         sys.exit(0)
-    
+
     elif global_options['printdeck']:
         del global_options['printdeck']
         print "# Copy and paste the lines below into a test deck to run the specified test with the specified arguments"
@@ -222,7 +222,7 @@ def runWithDirector(logging=True, start_tor=True):
 
         if config.advanced.debug:
             log.exception(failure)
-    
+
     # Wait until director has started up (including bootstrapping Tor)
     # before adding tests
     def post_director_start(_):
diff --git a/ooni/tests/test_oonicli.py b/ooni/tests/test_oonicli.py
index edd17c6..cf6a340 100644
--- a/ooni/tests/test_oonicli.py
+++ b/ooni/tests/test_oonicli.py
@@ -34,11 +34,17 @@ class TestRunDirector(unittest.TestCase):
             f.write('http://torproject.org/\n')
             f.write('http://bridges.torproject.org/\n')
             f.write('http://blog.torproject.org/\n')
-    
+
     def tearDown(self):
-        os.remove('test_report.yaml')
-        os.remove('example-input.txt')
-    
+        try:
+            os.remove('test_report.yaml')
+        except:
+            pass
+        try:
+            os.remove('example-input.txt')
+        except:
+            pass
+
     @defer.inlineCallbacks
     def run_test(self, test_name, args, verify_function):
         output_file = 'test_report.yaml'
@@ -91,8 +97,8 @@ class TestRunDirector(unittest.TestCase):
             assert 'control_resolver' in entry
             assert 'tampering' in entry
             assert len(entry['tampering']) == 1
-        yield self.run_test('blocking/dns_consistency', 
-                            ['-b', '8.8.8.8:53', 
+        yield self.run_test('blocking/dns_consistency',
+                            ['-b', '8.8.8.8:53',
                              '-t', '8.8.8.8',
                              '-f', 'example-input.txt'],
                             verify_function)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits