| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| 1 | import subprocess |
||
| 13 | class CorrectionBasedBearTest(LocalBearTestHelper): |
||
| 14 | """ |
||
| 15 | This test only covers corner cases. The basic functionality is tested in |
||
| 16 | a more intuitive way in the IndentBearTest. |
||
| 17 | """ |
||
| 18 | |||
| 19 | def setUp(self): |
||
| 20 | self.section = Section('') |
||
| 21 | self.queue = Queue() |
||
| 22 | self.uut = IndentBear(self.section, self.queue) |
||
| 23 | |||
| 24 | def test_errors(self): |
||
| 25 | old_binary, self.uut.BINARY = self.uut.BINARY, "invalid_stuff_here" |
||
| 26 | |||
| 27 | self.uut.execute(filename='', file=[]) |
||
| 28 | self.queue.get() |
||
| 29 | self.assertRegex(str(self.queue.get()), r'\[WARNING\] .*') |
||
| 30 | |||
| 31 | self.uut.BINARY = old_binary |
||
| 32 | |||
| 33 | def test_missing_binary(self): |
||
| 34 | old_binary = self.uut.BINARY |
||
| 35 | |||
| 36 | self.uut.BINARY = "fdgskjfdgjdfgnlfdslk" |
||
| 37 | self.assertEqual(self.uut.check_prerequisites(), |
||
| 38 | "fdgskjfdgjdfgnlfdslk is not installed.") |
||
| 39 | |||
| 40 | self.uut.BINARY = old_binary |
||
| 41 | |||
| 48 |