From 035dfacb1d7e76d1e8f9ed7a071704241f73aa92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristopher=20Pinz=C3=B3n?= <18080804+pinzon@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:25:34 -0500 Subject: [PATCH] Batch: fix job parameters definition (#8043) --- moto/batch/models.py | 2 +- tests/test_batch/test_batch_jobs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/batch/models.py b/moto/batch/models.py index 9885cf809f8f..e0f72540f45f 100644 --- a/moto/batch/models.py +++ b/moto/batch/models.py @@ -639,7 +639,7 @@ def _add_parameters_to_command(self, command: Union[str, List[str]]) -> List[str return command new_command = [ - command_part.replace(f"${param}", value) + command_part.replace(f"Ref::{param}", value) for command_part in command for param, value in self.parameters.items() ] diff --git a/tests/test_batch/test_batch_jobs.py b/tests/test_batch/test_batch_jobs.py index ae52075b8d11..724d9f61dc6c 100644 --- a/tests/test_batch/test_batch_jobs.py +++ b/tests/test_batch/test_batch_jobs.py @@ -1126,7 +1126,7 @@ def test_submit_job_with_parameters(): "image": "busybox", "vcpus": 1, "memory": 512, - "command": ["sleep", "$seconds"], + "command": ["sleep", "Ref::seconds"], }, parameters={"seconds": "0"}, )