Refactor container.exec_run usages

This commit is contained in:
Ayaz Salikhov
2025-03-10 00:49:28 +00:00
parent f2b42fd461
commit 0510a43920
12 changed files with 36 additions and 36 deletions

View File

@@ -44,12 +44,12 @@ def test_matplotlib(
command=["bash", "-c", "sleep infinity"],
)
command = f"python {cont_data_dir}/{test_file}"
cmd = running_container.exec_run(command)
LOGGER.debug(cmd.output.decode())
assert cmd.exit_code == 0, f"Command {command} failed"
exec_result = running_container.exec_run(command)
LOGGER.debug(exec_result.output.decode())
assert exec_result.exit_code == 0, f"Command {command} failed"
# Checking if the file is generated
# https://stackoverflow.com/a/15895594/4413446
command = f"test -s {output_dir}/{expected_file}"
cmd = running_container.exec_run(command)
LOGGER.debug(cmd.output.decode())
assert cmd.exit_code == 0, f"Command {command} failed"
exec_result = running_container.exec_run(command)
LOGGER.debug(exec_result.output.decode())
assert exec_result.exit_code == 0, f"Command {command} failed"