Ejemplo n.º 1
0
 def test_file_contains_no_match(self):
     # fileContains might find no match
     mysetup = BasicTestSetup(cave, regexp_list=["MARKER", ])
     path = self.create_file(b"Line 1\nLine 2\nLine 3\n\n")
     assert mysetup.fileContains(path) is False
Ejemplo n.º 2
0
 def test_file_contains_copes_with_strange_encodings(self):
     # we can also parse files that are not utf-8 or similar
     mysetup = BasicTestSetup(cave, regexp_list=["MARKER", ])
     path = self.create_file(b"Line 1\n \xff\xfeW[ \nMARKER\n\n")
     assert mysetup.fileContains(path) is True
Ejemplo n.º 3
0
 def test_file_contains_match(self):
     # the fileContains method finds matches
     mysetup = BasicTestSetup(cave, regexp_list=["MARKER", ])
     path = self.create_file(b"Line 1\nLine 2\nMARKER in file\n\n")
     assert mysetup.fileContains(path) is True