mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
tests: add argument to is_in_log so we can check only recent log entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
2fbe3161a0
commit
0d3eaef945
@@ -108,11 +108,11 @@ class TailableProc(object):
|
|||||||
self.running = False
|
self.running = False
|
||||||
self.proc.stdout.close()
|
self.proc.stdout.close()
|
||||||
|
|
||||||
def is_in_log(self, regex):
|
def is_in_log(self, regex, start = 0):
|
||||||
"""Look for `regex` in the logs."""
|
"""Look for `regex` in the logs."""
|
||||||
|
|
||||||
ex = re.compile(regex)
|
ex = re.compile(regex)
|
||||||
for l in self.logs:
|
for l in self.logs[start:]:
|
||||||
if ex.search(l):
|
if ex.search(l):
|
||||||
logging.debug("Found '%s' in logs", regex)
|
logging.debug("Found '%s' in logs", regex)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user