Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
1 | import os |
||
11 | class coalaFormatTest(unittest.TestCase): |
||
|
|||
12 | |||
13 | def setUp(self): |
||
14 | self.old_argv = sys.argv |
||
15 | |||
16 | def tearDown(self): |
||
17 | sys.argv = self.old_argv |
||
18 | |||
19 | def test_line_count(self): |
||
20 | with bear_test_module(), \ |
||
21 | prepare_file(["#fixme"], None) as (lines, filename): |
||
22 | retval, output = execute_coala(coala_format.main, "coala-format", |
||
23 | "-c", os.devnull, |
||
24 | "-f", re.escape(filename), |
||
25 | "-b", "LineCountTestBear") |
||
26 | self.assertRegex(output, r'message:This file has [0-9]+ lines.', |
||
27 | "coala-format output for line count should " |
||
28 | "not be empty") |
||
29 | self.assertEqual(retval, 1, |
||
30 | "coala-format must return exitcode 1 when it " |
||
31 | "yields results") |
||
32 |