[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Clean up Director tests
commit eca15ac53d2217e1d6a86cc36b9aefbaa94d46d3
Author: aagbsn <aagbsn@xxxxxxxx>
Date: Sat Jan 26 11:17:02 2013 +0000
Clean up Director tests
---
tests/test_director.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/test_director.py b/tests/test_director.py
index 365c11f..484cb21 100644
--- a/tests/test_director.py
+++ b/tests/test_director.py
@@ -2,6 +2,7 @@ from twisted.internet import defer, base
from twisted.trial import unittest
from ooni.director import Director
+from ooni.nettest import NetTestLoader
from tests.mocks import MockReporter
base.DelayedCall.debug = True
@@ -25,7 +26,7 @@ class DummyTestCase(NetTestCase):
"""
-dummyOptions = {'spam': 1, 'file': 'dummyInputFile.txt'}
+dummyArgs = ('--spam', 1, '--file', 'dummyInputFile.txt')
class TestDirector(unittest.TestCase):
timeout = 1
@@ -34,14 +35,16 @@ class TestDirector(unittest.TestCase):
for i in range(10):
f.write("%s\n" % i)
- reporters = [MockReporter]
- self.director = Director(reporters)
+ self.reporters = [MockReporter()]
+ self.director = Director()
def tearDown(self):
pass
def test_start_net_test(self):
- d = self.director.startTest(net_test_string, dummyOptions)
+ net_test_loader = NetTestLoader(net_test_string, dummyArgs)
+ net_test_loader.checkOptions()
+ d = self.director.startNetTest('', net_test_loader, self.reporters)
@d.addCallback
def done(result):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits