| Total Complexity | 2 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| 1 | import os |
||
| 15 | @skipIf(which('golint') is None, 'golint is not installed') |
||
| 16 | class GoLintBearTest(LocalBearTestHelper): |
||
| 17 | |||
| 18 | def setUp(self): |
||
| 19 | self.section = Section("Test Section") |
||
| 20 | self.uut = GoLintBear(self.section, Queue()) |
||
| 21 | self.good_file = os.path.join(os.path.dirname(__file__), |
||
| 22 | "test_files", |
||
| 23 | "golint_good.go") |
||
| 24 | self.bad_file = os.path.join(os.path.dirname(__file__), |
||
| 25 | "test_files", |
||
| 26 | "golint_bad.go") |
||
| 27 | |||
| 28 | def test_run(self): |
||
| 29 | self.assertLinesValid(self.uut, [], self.good_file) |
||
| 30 | self.assertLinesInvalid(self.uut, [], self.bad_file) |
||
| 31 | self.section.append(Setting("golint_cli_options", |
||
| 32 | "-min_confidence=0.8")) |
||
| 33 | self.assertLinesInvalid(self.uut, [], self.bad_file) |
||
| 34 | |||
| 37 |