diff options
author | Alan Rominger <arominge@redhat.com> | 2020-11-25 16:04:48 +0100 |
---|---|---|
committer | Alan Rominger <arominge@redhat.com> | 2020-11-25 16:04:48 +0100 |
commit | 501cf297df6e8428b6544a4cfe95c2e631258e05 (patch) | |
tree | 3148733ce6f6930398092f87e6a49ac46aeb6889 /awxkit | |
parent | Merge pull request #8668 from jakemcdermott/zuul-updates-ship-ui-next (diff) | |
download | awx-501cf297df6e8428b6544a4cfe95c2e631258e05.tar.xz awx-501cf297df6e8428b6544a4cfe95c2e631258e05.zip |
Apply more rigor to asserting text in stdout
Diffstat (limited to 'awxkit')
-rw-r--r-- | awxkit/awxkit/api/pages/unified_jobs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/awxkit/awxkit/api/pages/unified_jobs.py b/awxkit/awxkit/api/pages/unified_jobs.py index b2f72d9447..8e07b71de9 100644 --- a/awxkit/awxkit/api/pages/unified_jobs.py +++ b/awxkit/awxkit/api/pages/unified_jobs.py @@ -46,9 +46,11 @@ class UnifiedJob(HasStatus, base.Base): Additionally, you may replace any ' ' with another character (including ''). This is applied after the newline replacement. Default behavior is to not replace spaces. """ + self.wait_until_completed() stdout = self.result_stdout if replace_newlines is not None: - stdout = stdout.replace('\n', replace_newlines) + # make text into string with no line breaks, but watch out for trailing whitespace + stdout = replace_newlines.join([line.strip() for line in stdout.split('\n')]) if replace_spaces is not None: stdout = stdout.replace(' ', replace_spaces) if expected_text not in stdout: |