|
| 1 | +from queue import Queue |
| 2 | + |
1 | 3 | from bears.dart.DartLintBear import DartLintBear
|
2 |
| -from tests.LocalBearTestHelper import verify_local_bear |
| 4 | +from coalib.settings.Section import Section |
| 5 | +from coalib.settings.Setting import Setting |
| 6 | +from tests.LocalBearTestHelper import verify_local_bear, LocalBearTestHelper |
| 7 | +from tests.BearTestHelper import generate_skip_decorator |
3 | 8 |
|
4 | 9 |
|
5 | 10 | good_file = """
|
|
30 | 35 | valid_files=(good_file,),
|
31 | 36 | invalid_files=(bad_file,),
|
32 | 37 | tempfile_kwargs={"suffix": ".dart"})
|
| 38 | + |
| 39 | + |
| 40 | +@generate_skip_decorator(DartLintBear) |
| 41 | +class DartLintBearConfigTest(LocalBearTestHelper): |
| 42 | + |
| 43 | + def test_config_failure_use_spaces(self): |
| 44 | + section = Section("name") |
| 45 | + section.append(Setting('use_spaces', False)) |
| 46 | + bear = DartLintBear(section, Queue()) |
| 47 | + |
| 48 | + with self.assertRaises(AssertionError): |
| 49 | + self.check_validity(bear, [], good_file) |
| 50 | + |
| 51 | + def test_config_failure_wrong_indent_size(self): |
| 52 | + section = Section("name") |
| 53 | + section.append(Setting('indent_size', 3)) |
| 54 | + bear = DartLintBear(section, Queue()) |
| 55 | + |
| 56 | + with self.assertRaises(AssertionError): |
| 57 | + self.check_validity(bear, [], good_file) |
0 commit comments