Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/process_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __exit__(self, exc_type=None, exc_value=None, exc_traceback=None):
close = __exit__


def wait_for_strings(cb, seconds, *strings):
def wait_for_strings(cb, seconds, *strings, ignore_case=False):
"""
This checks that *string appear in cb(), IN THE GIVEN ORDER !
"""
Expand All @@ -232,7 +232,11 @@ def wait_for_strings(cb, seconds, *strings):
buff = cb()
check_strings = list(strings)
check_strings.reverse()
if ignore_case:
check_strings = [string.casefold() for string in check_strings]
for line in buff.splitlines():
if ignore_case:
line = line.casefold()
if not check_strings:
break
while check_strings and check_strings[-1] in line:
Expand Down