commit cf764e5c195fefc70d215b73490ecffc303bec6e Author: Isis Lovecruft isis@torproject.org Date: Sun Nov 4 05:16:45 2012 +0000
* Started creating the Options constructor. --- ooni/nettest.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ooni/nettest.py b/ooni/nettest.py index f8f3e30..4010199 100644 --- a/ooni/nettest.py +++ b/ooni/nettest.py @@ -72,11 +72,11 @@ class NetTestAdaptor(unittest.TestCase):
@classmethod def __new__(cls, *args, **kwargs): - super( NetTestAdaptor, cls ).__new__(*args, **kwargs) if hasattr(cls, "setUpClass"): - super( NetTestAdaptor, cls ).setUpClass() + super( NetTestAdaptor, cls ).setUpClass(cls) else: log.debug("NetTestAdaptor: constructor could not find setUpClass") + return super( NetTestAdaptor, cls ).__new__(cls, *args, **kwargs)
def __init__(self, *args, **kwargs): """ @@ -253,6 +253,9 @@ class NetTestAdaptor(unittest.TestCase): def __optstruct__(cls):
+ def buildUsageOptions(self, *args, **kwargs): + pass + @classmethod def setUpClass(cls): """ @@ -271,8 +274,10 @@ class NetTestAdaptor(unittest.TestCase): cls.parsed_inputs = __get_inputs__(cls)
## XXX we should handle options generation here - cls._opt_param = __copyattr__(cls, "optParameters") - cls._opt_su + cls._opt_parameters = __copyattr__(cls, "optParameters") + cls._opt_flags = __copyattr__(cls, "optFlags") + cls._sub_commands = __copyattr__(cls, "subCommands") + cls._sub_options = __copyattr__(cls, "subOptions")
class NetTestCase(NetTestAdaptor):
tor-commits@lists.torproject.org