Skip to content

Commit

Permalink
selftests: Allow multiple matches in one call
Browse files Browse the repository at this point in the history
sometimes we want to check multiple parts of the same string.

Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Dec 20, 2022
1 parent 0b851e0 commit fff278c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selftests/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def check_calls(self, acts, exps):
"""
i = 0
for call in acts:
if exps[i] in str(call):
while exps[i] in str(call):
i += 1
if len(exps) == i:
break
return
self.assertEqual(i, len(exps), "Some calls were not present at all or"
" in the expected order. Expected:\n%s\n\nActual:\n%s"
% ("\n".join(str(_) for _ in exps),
Expand Down

0 comments on commit fff278c

Please sign in to comment.