| Total Complexity | 4 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import unittest |
||
| 10 | class PrintDebugMessageActionTest(unittest.TestCase): |
||
| 11 | |||
| 12 | def setUp(self): |
||
| 13 | self.uut = PrintDebugMessageAction() |
||
| 14 | self.test_result = Result("origin", "message", debug_msg="DEBUG MSG") |
||
| 15 | |||
| 16 | def test_is_applicable(self): |
||
| 17 | self.assertFalse(self.uut.is_applicable(1, None, None)) |
||
| 18 | self.assertFalse(self.uut.is_applicable(Result("o", "m"), None, None)) |
||
| 19 | self.assertTrue(self.uut.is_applicable(self.test_result, None, None)) |
||
| 20 | |||
| 21 | def test_apply(self): |
||
| 22 | with retrieve_stdout() as stdout: |
||
| 23 | self.assertEqual(self.uut.apply_from_section(self.test_result, |
||
| 24 | {}, |
||
| 25 | {}, |
||
| 26 | Section("name")), |
||
| 27 | {}) |
||
| 28 | self.assertEqual(stdout.getvalue(), |
||
| 29 | self.test_result.debug_msg+"\n") |
||
| 30 |