Esempio n. 1
0
    def test_rule_001_default_do_not_allow_indenting(self):
        oRule = block_comment.rule_001()
        oRule.allow_indenting = False

        lExpected = [6, 14, 18, 22, 38]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 2
0
    def test_rule_001_plus(self):
        oRule = block_comment.rule_001()
        oRule.header_left = '+'
        oRule.max_header_column = 80

        lExpected = [2, 14, 18, 22, 26, 38]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 3
0
    def test_rule_001_default(self):
        oRule = block_comment.rule_001()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'block_comment')
        self.assertEqual(oRule.identifier, '001')

        lExpected = [6, 14, 18, 22, 26, 38]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 4
0
    def test_rule_001_default_w_header(self):
        oRule = block_comment.rule_001()
        oRule.header_left_repeat = '-'
        oRule.header_string = '<-    80 chars    ->'
        oRule.header_right_repeat = '-'
        oRule.header_alignment = 'center'
        oRule.max_header_column = 80

        lExpected = [2, 6, 14, 18, 22, 26]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
Esempio n. 5
0
    def test_rule_001_plus_w_header_string_right_justified(self):
        oRule = block_comment.rule_001()
        oRule.header_left = '+'
        oRule.max_header_column = 80
        oRule.header_string = '[ abcdef ]'
        oRule.header_right_repeat = '='
        oRule.header_alignment = 'right'

        lExpected = [2, 6, 14, 18, 26, 38]

        oRule.analyze(self.oFile)
        self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))