提交 6fe692b2 编写于 作者: L Lukáš Doktor

examples.tests: Rename failtest_nasty* to errortest_nasty*

The name was not correct as the test should error-out.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 7234c717
......@@ -23,7 +23,7 @@ class FailTest(Test):
def test(self):
"""
Should fail not-that-badly
Avocado should report this as TestError.
"""
raise NastyException("Nasty-string-like-exception")
......
......@@ -23,7 +23,7 @@ class FailTest(Test):
def test(self):
"""
Should fail.
Avocado should report this as TestError.
"""
raise NastyException(None) # str(Exception) fails!
......
......@@ -23,7 +23,7 @@ class FailTest(Test):
def test(self):
"""
Should fail not-that-badly
Avocado should report this as TestError.
"""
raise NastyException("Nasty-string-like-exception")
......
......@@ -45,28 +45,28 @@ class StandaloneTests(unittest.TestCase):
expected_rc = 1
self.run_and_check(cmd_line, expected_rc, 'failtest')
def test_failtest_nasty(self):
cmd_line = './examples/tests/failtest_nasty.py -r'
def test_errortest_nasty(self):
cmd_line = './examples/tests/errortest_nasty.py -r'
expected_rc = 1
result = self.run_and_check(cmd_line, expected_rc, 'failtest_nasty')
result = self.run_and_check(cmd_line, expected_rc, 'errortest_nasty')
exc = "NastyException: Nasty-string-like-exception"
count = result.stdout.count("\n%s" % exc)
self.assertEqual(count, 2, "Exception \\n%s should be present twice in"
"the log (once from the log, second time when parsing"
"exception details." % (exc))
def test_failtest_nasty2(self):
cmd_line = './examples/tests/failtest_nasty2.py -r'
def test_errortest_nasty2(self):
cmd_line = './examples/tests/errortest_nasty2.py -r'
expected_rc = 1
result = self.run_and_check(cmd_line, expected_rc, 'failtest_nasty2')
result = self.run_and_check(cmd_line, expected_rc, 'errortest_nasty2')
self.assertIn("Exception: Unable to get exception, check the traceback"
" for details.", result.stdout)
def test_failtest_nasty3(self):
cmd_line = './examples/tests/failtest_nasty3.py -r'
def test_errortest_nasty3(self):
cmd_line = './examples/tests/errortest_nasty3.py -r'
expected_rc = 1
result = self.run_and_check(cmd_line, expected_rc, 'failtest_nasty3')
self.assertIn("TestError: <failtest_nasty3.NastyException instance at ",
result = self.run_and_check(cmd_line, expected_rc, 'errortest_nasty3')
self.assertIn("TestError: <errortest_nasty3.NastyException instance at ",
result.stdout)
def test_errortest(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册