def test_fix_rule_013(self): oRule = type_definition.rule_013() dExpected = [] oRule.fix(self.oFile) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, dExpected) self.assertEqual(self.oFile.lines[13].line, ' type interface is record')
def test_rule_013(self): oRule = type_definition.rule_013() self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '013') dExpected = [13] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_013(self): oRule = type_definition.rule_013() self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '013') dExpected = [{'line_number': 13, 'words_to_fix': {'IS'}}] oRule.analyze(oFile) self.assertEqual(oRule.violations, dExpected)
def test_rule_013_upper(self): oRule = type_definition.rule_013() oRule.case = 'upper' self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '013') lExpected = [4] oRule.analyze(self.oFile) self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
def test_fix_rule_013_lower(self): oRule = type_definition.rule_013() oRule.fix(self.oFile) lActual = self.oFile.get_lines() self.assertEqual(lExpected_lower, lActual) oRule.analyze(self.oFile) self.assertEqual(oRule.violations, [])
def test_rule_013(self): oRule = type_definition.rule_013() self.assertTrue(oRule) self.assertEqual(oRule.name, 'type') self.assertEqual(oRule.identifier, '013') lExpected = [] dViolation = utils.add_violation(13) dViolation['words_to_fix'] = {'IS'} lExpected.append(dViolation) oRule.analyze(oFile) self.assertEqual(oRule.violations, lExpected)