コード例 #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, [])
コード例 #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, [])
コード例 #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, [])
コード例 #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'])
コード例 #5
0
ファイル: plugin_tests.py プロジェクト: sosiouxme/sosreport
 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, [])