From 9ea43c26633135e3bb9274cc55d0fe34d35b1ae3 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Fri, 10 Sep 2021 16:29:02 +0000 Subject: [PATCH] update(test): check output order in output_strictly_contains Signed-off-by: Jason Dellaluce --- test/falco_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/falco_test.py b/test/falco_test.py index a98958ef..77f750d5 100644 --- a/test/falco_test.py +++ b/test/falco_test.py @@ -409,12 +409,15 @@ class FalcoTest(Test): else: actual = open(output['actual']).read() + actual_cursor = actual expected_lines = expected.splitlines() for line in expected_lines: - if line not in actual: + pos = actual_cursor.find(line) + if pos < 0: self.fail("Output '{}' does not strictly contains the expected content '{}'".format( output['actual'], output['expected'])) return False + actual_cursor = actual_cursor[pos + len(line):] return True