Skip to content

Commit f921bb8

Browse files
authored
Add basic doc for file.contains (#673)
1 parent 5d558f0 commit f921bb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

testinfra/modules/file.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ def mode(self):
116116
raise NotImplementedError
117117

118118
def contains(self, pattern):
119+
"""Checks content of file for pattern
120+
121+
This uses grep and thus follows the grep regex syntax.
122+
"""
119123
return self.run_test("grep -qs -- %s %s", pattern, self.path).rc == 0
120124

121125
@property

0 commit comments

Comments
 (0)