Exemplo n.º 1
0
 def test_rule_010(self):
     oRule = constant.rule_010()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'constant')
     self.assertEqual(oRule.identifier, '010')
     lExpected = utils.add_violation_list([9, 38])
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, lExpected)
 def test_rule_010(self):
     oRule = constant.rule_010()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'constant')
     self.assertEqual(oRule.identifier, '010')
     dExpected = [9]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 3
0
    def test_fix_rule_010(self):
        oRule = constant.rule_010()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
Exemplo n.º 4
0
 def test_fix_rule_010(self):
     oRule = constant.rule_010()
     dExpected = []
     oRule.fix(self.oFile)
     oRule.analyze(self.oFile)
     self.assertEqual(oRule.violations, dExpected)
     self.assertEqual(self.oFile.lines[5].line,  '  constant c_const : std_logic := \'1\';')
     self.assertEqual(self.oFile.lines[6].line,  '  constant const : std_logic := \'0\';')
     self.assertEqual(self.oFile.lines[7].line,  '  COnstant  c_const : std_logic := \'1\';')
     self.assertEqual(self.oFile.lines[8].line,  'Constant c_coNST :  std_logic := \'0\';')
     self.assertEqual(self.oFile.lines[9].line,  'constant const  :  STD_LOGIC :=\'0\';')
     self.assertEqual(self.oFile.lines[10].line, '   constant c_const: std_logic')
     self.assertEqual(self.oFile.lines[38].line, '  constant const : std_logic := \'0\';')
Exemplo n.º 5
0
    def test_rule_010(self):
        oRule = constant.rule_010()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'constant')
        self.assertEqual(oRule.identifier, '010')

        lExpected = [6]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))
Exemplo n.º 6
0
 def test_fix_rule_010(self):
     oRule = constant.rule_010()
     dExpected = []
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)