[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] * Fixing ORunner not finding inputs.
commit 50286ad9c79a7023ccdfc1f0a3526fb7ff76865c
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Sun Nov 4 13:37:45 2012 +0000
* Fixing ORunner not finding inputs.
* Need to remove the generator class from inputunit.py.
---
ooni/nettest.py | 13 ++++++++-----
ooni/runner.py | 26 ++++++++++++--------------
2 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/ooni/nettest.py b/ooni/nettest.py
index 03e391e..94c8c56 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -428,13 +428,15 @@ class NetTestCase(NetTestAdaptor):
def getOptions(self):
log.debug("Getting options for test")
- if self.localOptions:
- if self.inputs[0] is not None or self.inputFile is not None:
- self.__get_inputs__()
- return self.localOptions
+ if self.local_options:
+ log.debug("NetTestCase: getOptions: self.local_options=%s"
+ % str(self.local_options))
else:
log.debug("could not find cls.localOptions!")
+ return {'inputs': self.parsed_inputs,
+ 'name': self.name,
+ 'version': self.version}
# if options:
# return options
# else:
@@ -446,6 +448,7 @@ class NetTestCase(NetTestAdaptor):
#return {'inputs': self.inputs,
# 'name': self.name,
# 'version': self.version}
-
+ '''
def __repr__(self):
return "<%s inputs=%s>" % (self.__class__, self.inputs)
+ '''
diff --git a/ooni/runner.py b/ooni/runner.py
index f6db105..d711153 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -237,22 +237,20 @@ class ORunner(object):
self.cases = cases
self.options = options
+ log.debug("ORunner: cases=%s" % type(cases))
+ log.debug("ORunner: options=%s" % options)
+
+
try:
- assert len(options) != 0, "Length of options is zero!"
- except AssertionError, ae:
- log.err(ae)
- self.inputs = []
- else:
- try:
- first = options.pop(0)
- except:
- first = options
+ first = options.pop(0)
+ except:
+ first = options
- if 'inputs' in first:
- self.inputs = options['inputs']
- else:
- log.msg("Could not find inputs!")
- self.inputs = [None]
+ if 'inputs' in first:
+ self.inputs = self.options['inputs']
+ else:
+ log.msg("Could not find inputs!")
+ self.inputs = [None]
try:
reportFile = open(config['reportfile'], 'a+')
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits