|
|
@ -78,7 +78,7 @@ class SimpleConfigTestCase(unittest.TestCase):
|
|
|
|
' spaces: 2\n'
|
|
|
|
' spaces: 2\n'
|
|
|
|
' indent-sequences: true\n'
|
|
|
|
' indent-sequences: true\n'
|
|
|
|
' check-multi-line-strings: false\n')
|
|
|
|
' check-multi-line-strings: false\n')
|
|
|
|
self.assertEqual(c.rules['indentation']['indent-sequences'], True)
|
|
|
|
self.assertTrue(c.rules['indentation']['indent-sequences'])
|
|
|
|
self.assertEqual(c.rules['indentation']['check-multi-line-strings'],
|
|
|
|
self.assertEqual(c.rules['indentation']['check-multi-line-strings'],
|
|
|
|
False)
|
|
|
|
False)
|
|
|
|
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ class SimpleConfigTestCase(unittest.TestCase):
|
|
|
|
' spaces: 2\n'
|
|
|
|
' spaces: 2\n'
|
|
|
|
' indent-sequences: yes\n'
|
|
|
|
' indent-sequences: yes\n'
|
|
|
|
' check-multi-line-strings: false\n')
|
|
|
|
' check-multi-line-strings: false\n')
|
|
|
|
self.assertEqual(c.rules['indentation']['indent-sequences'], True)
|
|
|
|
self.assertTrue(c.rules['indentation']['indent-sequences'])
|
|
|
|
self.assertEqual(c.rules['indentation']['check-multi-line-strings'],
|
|
|
|
self.assertEqual(c.rules['indentation']['check-multi-line-strings'],
|
|
|
|
False)
|
|
|
|
False)
|
|
|
|
|
|
|
|
|
|
|
@ -115,8 +115,8 @@ class SimpleConfigTestCase(unittest.TestCase):
|
|
|
|
class Rule(object):
|
|
|
|
class Rule(object):
|
|
|
|
ID = 'fake'
|
|
|
|
ID = 'fake'
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(config.validate_rule_conf(Rule, False), False)
|
|
|
|
self.assertFalse(config.validate_rule_conf(Rule, False))
|
|
|
|
self.assertEqual(config.validate_rule_conf(Rule, 'disable'), False)
|
|
|
|
self.assertFalse(config.validate_rule_conf(Rule, 'disable'))
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(config.validate_rule_conf(Rule, {}),
|
|
|
|
self.assertEqual(config.validate_rule_conf(Rule, {}),
|
|
|
|
{'level': 'error'})
|
|
|
|
{'level': 'error'})
|
|
|
@ -194,7 +194,7 @@ class ExtendedConfigTestCase(unittest.TestCase):
|
|
|
|
new.extend(old)
|
|
|
|
new.extend(old)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(sorted(new.rules.keys()), ['colons', 'hyphens'])
|
|
|
|
self.assertEqual(sorted(new.rules.keys()), ['colons', 'hyphens'])
|
|
|
|
self.assertEqual(new.rules['colons'], False)
|
|
|
|
self.assertFalse(new.rules['colons'])
|
|
|
|
self.assertEqual(new.rules['hyphens']['max-spaces-after'], 2)
|
|
|
|
self.assertEqual(new.rules['hyphens']['max-spaces-after'], 2)
|
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual(len(new.enabled_rules(None)), 1)
|
|
|
|
self.assertEqual(len(new.enabled_rules(None)), 1)
|
|
|
|