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

[tor-commits] [ooni-probe/master] Fix bug when tests are started without the Asset argument



commit ab2a15e48c70ce69ade72b5b9cfeaea185049a3a
Author: Arturo Filastò <hellais@xxxxxxxxx>
Date:   Tue Mar 13 16:44:10 2012 -0700

    Fix bug when tests are started without the Asset argument
---
 ooniprobe.py        |    7 +++++--
 tests/bridget.py    |    2 +-
 tests/traceroute.py |    2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ooniprobe.py b/ooniprobe.py
index f2f323d..9d9c0ac 100755
--- a/ooniprobe.py
+++ b/ooniprobe.py
@@ -141,12 +141,15 @@ class ooni(object):
             except Exception, e:
                 self.logger.error("ERR: %s" % e)
 
-    def run_test(self, test, asset):
+    def run_test(self, test, asset=None):
         """
         Run a single test
         """
         self.load_tests()
-        self.tests[test].module.run(self, asset)
+        if asset:
+            self.tests[test].module.run(self, asset)
+        else:
+            self.tests[test].module.run(self)
 
 if __name__ == "__main__":
 
diff --git a/tests/bridget.py b/tests/bridget.py
index 61fc8b7..da014fd 100644
--- a/tests/bridget.py
+++ b/tests/bridget.py
@@ -357,7 +357,7 @@ Log info file %s
     #def msg(self, severity, message):
     #   print "[%s] %s"%(severity, message)
 
-def run(ooni):
+def run(ooni, assets=None):
     """
     Run the test
     """
diff --git a/tests/traceroute.py b/tests/traceroute.py
index 891d356..d84bf25 100644
--- a/tests/traceroute.py
+++ b/tests/traceroute.py
@@ -21,7 +21,7 @@ __desc__ = "Performs TTL walking tests"
 
 class TracerouteAsset(Asset):
     def __init__(self, file=None):
-        self = asset.__init__(self, file)
+        self = Asset.__init__(self, file)
 
 
 class Traceroute(Test):

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