From 17ca02e10623b12065532b26de9cefcccee0062c Mon Sep 17 00:00:00 2001 From: James Falcon Date: Wed, 9 Dec 2020 15:49:11 -0600 Subject: Add integration test for power_state_change module (#717) Also introduce the `unstable` mark, to allow us to land tests which run inconsistently (such as this one). --- tests/integration_tests/log_utils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/integration_tests/log_utils.py (limited to 'tests/integration_tests/log_utils.py') diff --git a/tests/integration_tests/log_utils.py b/tests/integration_tests/log_utils.py new file mode 100644 index 00000000..fa807389 --- /dev/null +++ b/tests/integration_tests/log_utils.py @@ -0,0 +1,13 @@ +def ordered_items_in_text(to_verify: list, text: str) -> bool: + """Return if all items in list appear in order in text. + + Examples: + ordered_items_in_text(['a', '1'], 'ab1') # Returns True + ordered_items_in_text(['1', 'a'], 'ab1') # Returns False + """ + index = 0 + for item in to_verify: + index = text[index:].find(item) + if index < 0: + return False + return True -- cgit v1.2.3