From 809d7d27974228bcb0e005f25c608bac756b4496 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 24 Jan 2024 18:18:17 -0500 Subject: [PATCH] fix bug in docker_build.py --- biweeklybudget/tests/docker_build.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/biweeklybudget/tests/docker_build.py b/biweeklybudget/tests/docker_build.py index f7d3a19..0730459 100755 --- a/biweeklybudget/tests/docker_build.py +++ b/biweeklybudget/tests/docker_build.py @@ -486,15 +486,14 @@ def _test_scripts(self, container): ] for cmd_info in test_cmds: logger.debug('Running: %s', cmd_info['cmd']) - res = container.exec_run(cmd_info['cmd']).decode().strip() - logger.debug('Command output:\n%s', res) - if 'output' in cmd_info: - if cmd_info['output'] not in res: - raise RuntimeError( - 'Expected %s output to include "%s" but it did not' % ( - cmd_info['cmd'], cmd_info['output'] - ) + ecode, res = container.exec_run(cmd_info['cmd']) + logger.debug('Command exited %d; output:\n%s', ecode, res) + if 'output' in cmd_info and cmd_info['output'] not in res.decode(): + raise RuntimeError( + 'Expected %s output to include "%s" but it did not' % ( + cmd_info['cmd'], cmd_info['output'] ) + ) logger.info('script tests SUCCEEDED') def _run_mysql(self):