@@ -22,6 +22,9 @@ def setUp(self):
22
22
self .empty_config = os .path .join (test_files ,
23
23
"checkstyle_empty_config.xml" )
24
24
25
+ def tearDown (self ):
26
+ self .section = Section ("test section" )
27
+
25
28
def test_run (self ):
26
29
self .check_validity (self .uut , [], self .good_file )
27
30
self .check_validity (self .uut , [], self .bad_file , valid = False )
@@ -30,6 +33,18 @@ def test_known_configs(self):
30
33
self .section ["checkstyle_configs" ] = "google"
31
34
self .check_validity (self .uut , [], self .good_file )
32
35
36
+ def test_config_failure_use_spaces (self ):
37
+ self .section ["checkstyle_configs" ] = "google"
38
+ self .section .append (Setting ('use_spaces' , False ))
39
+ with self .assertRaises (AssertionError ):
40
+ self .check_validity (self .uut , [], self .good_file )
41
+
42
+ def test_config_failure_indent_size (self ):
43
+ self .section ["checkstyle_configs" ] = "google"
44
+ self .section .append (Setting ('indent_size' , 3 ))
45
+ with self .assertRaises (AssertionError ):
46
+ self .check_validity (self .uut , [], self .good_file )
47
+
33
48
def test_with_custom_configfile (self ):
34
49
self .section ["checkstyle_configs" ] = self .empty_config
35
50
self .check_validity (self .uut , [], self .good_file )
0 commit comments