[tor-commits] [ooni-probe/master] Write test case for worker
art at torproject.org
art at torproject.org
Thu May 31 13:41:27 UTC 2012
commit 29cc044b50cf0fdc8bfad97f194ea7fa993e08e6
Author: Arturo Filastò <hellais at 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)
+
More information about the tor-commits
mailing list