You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
780 B

  1. import unittest
  2. from reportbug import hiermatch, exceptions
  3. test_strings_list = ['Beautiful is better than ugly.',
  4. 'Explicit is better than implicit.',
  5. 'Simple is better than complex.',
  6. 'Complex is better than complicated.',
  7. 'Flat is better than nested.',
  8. 'Sparse is better than dense.']
  9. class TestHiermatch(unittest.TestCase):
  10. def test_egrep_list(self):
  11. res = hiermatch.egrep_list(None, '')
  12. self.assertIsNone(res)
  13. with self.assertRaises(exceptions.InvalidRegex):
  14. matches = hiermatch.egrep_list(test_strings_list, 42)
  15. matches = hiermatch.egrep_list(test_strings_list, 'better')
  16. self.assertEqual(len(matches), 6)