summaryrefslogtreecommitdiff
path: root/tests/testutils/runcli.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testutils/runcli.py')
-rw-r--r--tests/testutils/runcli.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index ce5864bdf..f94cec8ae 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -153,6 +153,20 @@ class Result():
assert self.task_error_domain == error_domain, fail_message
assert self.task_error_reason == error_reason, fail_message
+ # assert_shell_error()
+ #
+ # Asserts that the buildstream created a shell and that the task in the
+ # shell failed.
+ #
+ # Args:
+ # fail_message (str): An optional message to override the automatic
+ # assertion error messages
+ # Raises:
+ # (AssertionError): If any of the assertions fail
+ #
+ def assert_shell_error(self, fail_message=''):
+ assert self.exit_code == 1, fail_message
+
# get_tracked_elements()
#
# Produces a list of element names on which tracking occurred