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, [])
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, [])
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'])
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, [])