Ejemplo n.º 1
0
    def test_failroute(self):
        input_strings = """.F
======================================================================
FAIL: test_dummy_fail (__main__.TestDummy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_pyrg_ng.py", line 140, in test_dummy_fail
    self.assertEqual(1, 2)
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (failures=1)
"""
        result_strings = """.F
======================================================================
FAIL: test_dummy_fail (__main__.TestDummy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_pyrg_ng.py", line 140, in test_dummy_fail
    self.assertEqual(1, 2)
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (failures=1)"""
        ret = pyrg.parse_unittest_result(input_strings.splitlines(1))
        self.assertEqual(ret, result_strings)
Ejemplo n.º 2
0
    def test_errorroute(self):
        input_strings = """.E
======================================================================
ERROR: test_dummy_error (__main__.TestDummy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_pyrg_ng.py", line 143, in test_dummy_error
    self.assertEqual(1, a)
NameError: global name 'a' is not defined

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (errors=1)
"""
        result_strings = """.E
======================================================================
ERROR: test_dummy_error (__main__.TestDummy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_pyrg_ng.py", line 143, in test_dummy_error
    self.assertEqual(1, a)
NameError: global name 'a' is not defined

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (errors=1)"""
        ret = pyrg.parse_unittest_result(input_strings.splitlines(1))
        self.assertEqual(ret, result_strings)
Ejemplo n.º 3
0
    def test_okroute(self):
        input_strings = """..
----------------------------------------------------------------------
Ran 2 tests in 0.000s

OK
"""
        result_strings = """..
----------------------------------------------------------------------
Ran 2 tests in 0.000s

OK"""
        ret = pyrg.parse_unittest_result(input_strings.splitlines(1))
        self.assertEqual(ret, result_strings)