def test_rules_should_not_contain_keywords_group(self): lint = RFLint('sample.txt') lint.rule(KeywordRule(should_not_contain=['Click', 'Submit'])) \ .rule(KeywordRule(should_not_contain=['Sleep'])) with self.assertRaises(UnexpectedKeywordException) as cm: lint.check() the_exception = cm.exception self.assertEqual(the_exception.error_msg, 'my first case contains: Sleep')
def test_count_lines(self): lint = RFLint('sample.txt') lint.check() self.assertEqual(9, lint.stat['line_count']) self.assertEqual(2, lint.stat['comment_line_count']) self.assertEqual(1, lint.stat['empty_line_count']) self.assertEqual(2, lint.stat['section_count']) self.assertEqual(4, lint.stat['row_count'])