Example #1
0
 def test_regex_findall_bad_input(self):
     matches = regex_findall(r".*", None)
     self.assertEquals(matches, [])
     matches = regex_findall(r".*", [])
     self.assertEquals(matches, [])
     matches = regex_findall(r".*", 1)
     self.assertEquals(matches, [])
Example #2
0
 def test_regex_findall_bad_input(self):
     matches = regex_findall(r".*", None)
     self.assertEquals(matches, [])
     matches = regex_findall(r".*", [])
     self.assertEquals(matches, [])
     matches = regex_findall(r".*", 1)
     self.assertEquals(matches, [])
Example #3
0
 def test_regex_findall_miss(self):
     test_s = "\n".join(['this is only a test', 'there are only two lines'])
     test_fo = StringIO(test_s)
     matches = regex_findall(r".*not_there$", test_fo)
     self.assertEquals(matches, [])
Example #4
0
 def test_regex_findall(self):
     test_s = "\n".join(['this is only a test', 'there are only two lines'])
     test_fo = StringIO(test_s)
     matches = regex_findall(r".*lines$", test_fo)
     self.assertEquals(matches, ['there are only two lines'])
Example #5
0
 def test_regex_findall_miss(self):
     test_s = "\n".join(["this is only a test", "there are only two lines"])
     test_fo = StringIO(test_s)
     matches = regex_findall(r".*not_there$", test_fo)
     self.assertEquals(matches, [])