summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/atfutils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/utils/atfutils.py b/libs/utils/atfutils.py
index 9b91ae2..86b2484 100644
--- a/libs/utils/atfutils.py
+++ b/libs/utils/atfutils.py
@@ -27,6 +27,22 @@ def assert_failure(**arguments):
else:
return 1
+def expect(actual_string, expected_string):
+ """
+ """
+ escaped_pattern = re.escape(expected_string)
+ new_pattern = re.compile(escaped_pattern, re.IGNORECASE)
+
+ matched = False
+ if not expected_string:
+ matched = True
+
+ else:
+ if re.search(new_pattern, actual_string):
+ matched = True
+
+ return matched
+
def print_stdout(stdoutdata):
"""
"""