def test_rule_008(self): oRule = concurrent.rule_008() self.assertTrue(oRule) self.assertEqual(oRule.name, 'concurrent') self.assertEqual(oRule.identifier, '008') dExpected = ['6-11'] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_fix_rule_008(self): oRule = concurrent.rule_008() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_008(self): oRule = concurrent.rule_008() self.assertTrue(oRule) self.assertEqual(oRule.name, 'concurrent') self.assertEqual(oRule.identifier, '008') lExpected = [15, 16, 17, 18, 29, 30, 31, 33, 53, 54, 61, 62, 71] oRule.analyze(self.oFile) self.assertEqual( lExpected, utils.extract_violation_lines_from_violation_object( oRule.violations))
def test_rule_008(self): oRule = concurrent.rule_008() self.assertTrue(oRule) self.assertEqual(oRule.name, 'concurrent') self.assertEqual(oRule.identifier, '008') dExpected = [{ 'lines': [{ 'number': 6, 'keyword_column': 27, 'before_keyword_column': 20 }, { 'number': 7, 'keyword_column': 19, 'before_keyword_column': 5 }, { 'number': 8, 'keyword_column': 14, 'before_keyword_column': 12 }, { 'number': 9, 'keyword_column': 23, 'before_keyword_column': 5 }, { 'number': 11, 'keyword_column': 18, 'before_keyword_column': 10 }], 'max_keyword_column': 27, 'max_before_keyword_column': 20 }, { 'lines': [{ 'number': 34, 'keyword_column': 19, 'before_keyword_column': 16 }], 'max_keyword_column': 19, 'max_before_keyword_column': 16 }] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)