commit df21761de0f0f887a2650a4fd97f0e3778bd4e6d Author: Arturo Filastò art@fuffa.org Date: Sun Nov 25 02:52:20 2012 +0100
Update unittests for runner * Remove superflous debug messages --- ooni/reporter.py | 8 -------- ooni/runner.py | 1 - tests/test_runner.py | 10 ++++++---- 3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/ooni/reporter.py b/ooni/reporter.py index 26c6e43..b79f27f 100644 --- a/ooni/reporter.py +++ b/ooni/reporter.py @@ -193,14 +193,6 @@ class OReporter(object): 'report': test_report} return self.writeReportEntry(report)
- def allDone(self): - log.debug("allDone: Finished running all tests") - try: - log.debug("Stopping the reactor") - except: - log.debug("Unable to stop the reactor") - return None - class YAMLReporter(OReporter): """ These are useful functions for reporting to YAML format. diff --git a/ooni/runner.py b/ooni/runner.py index bc271a6..d7856e6 100644 --- a/ooni/runner.py +++ b/ooni/runner.py @@ -279,5 +279,4 @@ def runTestCases(test_cases, options, cmd_line_options):
except Exception: log.exception("Problem in running test") - oreporter.allDone()
diff --git a/tests/test_runner.py b/tests/test_runner.py index fac4cd7..9b37d71 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -36,8 +36,6 @@ class TestRunner(unittest.TestCase): self.assertEqual(test_cases[1][1], 'test_a')
def test_run_testcase_with_input_unit(self): - oreporter = DummyReporter() - oreporter.dummy_report = [] def done(result): report = oreporter.dummy_report self.assertEqual(len(report), 5*2) @@ -50,6 +48,9 @@ class TestRunner(unittest.TestCase): input_unit = InputUnit([0,1,2,3,4]) cmd_line_options = {'collector': None}
+ oreporter = DummyReporter(cmd_line_options) + oreporter.dummy_report = [] + test_cases, options = loadTestsAndOptions([DummyTestCase], cmd_line_options)
@@ -58,8 +59,6 @@ class TestRunner(unittest.TestCase): return d
def test_with_post_processing(self): - oreporter = DummyReporter() - oreporter.dummy_report = [] def done(result): report = oreporter.dummy_report self.assertEqual(len(report), 3) @@ -70,6 +69,9 @@ class TestRunner(unittest.TestCase): input_unit = InputUnit([None]) cmd_line_options = {'collector': None}
+ oreporter = DummyReporter(cmd_line_options) + oreporter.dummy_report = [] + test_cases, options = loadTestsAndOptions([DummyTestCasePP], cmd_line_options)
tor-commits@lists.torproject.org