@@ -111,7 +111,12 @@ def mock_run(*popenargs, check=False, **kwargs):
111111@pytest .fixture
112112def run_load_task (mocker ):
113113 def inner (
114- task , remove = False , custom_image = None , pass_task_def = False , interactive = True
114+ task ,
115+ remove = False ,
116+ custom_image = None ,
117+ pass_task_def = False ,
118+ interactive = True ,
119+ volumes = None ,
115120 ):
116121 proc = mocker .MagicMock ()
117122 proc .returncode = 0
@@ -159,6 +164,7 @@ def inner(
159164 remove = remove ,
160165 custom_image = custom_image ,
161166 interactive = interactive ,
167+ volumes = volumes ,
162168 )
163169 return ret , mocks
164170
@@ -198,7 +204,9 @@ def test_load_task(run_load_task):
198204 "image" : {"taskId" : image_task_id , "type" : "task-image" },
199205 },
200206 }
201- ret , mocks = run_load_task (task )
207+ # Test with custom volumes
208+ volumes = {"/host/path" : "/container/path" , "/another/host" : "/another/container" }
209+ ret , mocks = run_load_task (task , volumes = volumes )
202210 assert ret == 0
203211
204212 if "get_task_definition" in mocks :
@@ -211,6 +219,10 @@ def test_load_task(run_load_task):
211219 "-v" ,
212220 re .compile (f"{ tempfile .gettempdir ()} /tmp.*:/builds/worker/.bashrc" ),
213221 re .compile (f"--env-file={ tempfile .gettempdir ()} /tmp.*" ),
222+ "-v" ,
223+ "/another/host:/another/container" ,
224+ "-v" ,
225+ "/host/path:/container/path" ,
214226 "-i" ,
215227 "-t" ,
216228 "image/tag" ,
0 commit comments