commit 29cc044b50cf0fdc8bfad97f194ea7fa993e08e6 Author: Arturo Filastò hellais@torproject.org Date: Thu May 31 15:38:48 2012 +0200
Write test case for worker --- tests/test_worker.py | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/tests/test_worker.py b/tests/test_worker.py new file mode 100644 index 0000000..e53750b --- /dev/null +++ b/tests/test_worker.py @@ -0,0 +1,18 @@ +from twisted.trial import unittest + +from ooni.plugoo import work, tests + +class WorkerTestCase(unittest.TestCase): + def testWorkGenerator(self): + class DummyTest: + assets = {} + dummytest = DummyTest() + asset = [] + for i in range(10): + asset.append(i) + dummytest.assets['asset'] = asset + wgen = work.WorkGenerator(dummytest) + for j, x in enumerate(wgen): + pass + self.assertEqual(i, j) +
tor-commits@lists.torproject.org