Updating tests for rule length_001 to improve code coverage:

1)  Added tests to verify _get_solution method returned the correct message.
This commit is contained in:
Jeremiah C Leary 2020-01-02 10:29:07 -06:00
parent 5e824dd37a
commit 7fffe18da3
1 changed files with 3 additions and 1 deletions

View File

@ -20,10 +20,12 @@ class testRuleLengthMethods(unittest.TestCase):
oRule.analyze(oFile)
self.assertEqual(oRule.violations, dExpected)
self.assertEqual('Reduce line to less than 120 characters', oRule._get_solution(0))
def test_rule_001_with_75_character_limit(self):
oRule = length.rule_001()
oRule.length = 75
dExpected = [1,3,4,7,9]
oRule.analyze(oFile)
self.assertEqual(oRule.violations, dExpected)
self.assertEqual('Reduce line to less than 75 characters', oRule._get_solution(0))