Total Complexity | 4 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import unittest |
||
10 | class PrintMoreInfoActionTest(unittest.TestCase): |
||
11 | |||
12 | def setUp(self): |
||
13 | self.uut = PrintMoreInfoAction() |
||
14 | self.test_result = Result( |
||
15 | "origin", "message", |
||
16 | additional_info="A lot of additional information can be found here") |
||
17 | |||
18 | def test_is_applicable(self): |
||
19 | self.assertFalse(self.uut.is_applicable(1, None, None)) |
||
20 | self.assertFalse(self.uut.is_applicable(Result("o", "m"), None, None)) |
||
21 | self.assertTrue(self.uut.is_applicable(self.test_result, None, None)) |
||
22 | |||
23 | def test_apply(self): |
||
24 | with retrieve_stdout() as stdout: |
||
25 | self.assertEqual(self.uut.apply_from_section(self.test_result, |
||
26 | {}, |
||
27 | {}, |
||
28 | Section("name")), |
||
29 | {}) |
||
30 | self.assertEqual(stdout.getvalue(), |
||
31 | self.test_result.additional_info + "\n") |
||
32 |