File tree Expand file tree Collapse file tree
components/renku_data_services/session
test/bases/renku_data_services/data_api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ async def update_launcher(
402402 launcher .environment = new_env
403403 else :
404404 # Fields on the environment attached to the launcher are being changed.
405- for key , val in env_payload :
405+ for key , val in env_payload . items () :
406406 # NOTE: Only some fields can be updated.
407407 if key in [
408408 "name" ,
@@ -415,7 +415,7 @@ async def update_launcher(
415415 "uid" ,
416416 "gid" ,
417417 ]:
418- setattr (launcher .environment , key , value )
418+ setattr (launcher .environment , key , val )
419419
420420 return launcher .dump ()
421421
Original file line number Diff line number Diff line change @@ -462,3 +462,13 @@ async def test_patch_session_launcher_environment(
462462 f"/api/data/session_launchers/{ launcher_id } " , headers = user_headers , json = patch_payload
463463 )
464464 assert res .status_code == 200 , res .text
465+
466+ # Should be able to patch some fields of the custom environment
467+ patch_payload = {
468+ "environment" : {"container_image" : "nginx:latest" },
469+ }
470+ _ , res = await sanic_client .patch (
471+ f"/api/data/session_launchers/{ launcher_id } " , headers = user_headers , json = patch_payload
472+ )
473+ assert res .status_code == 200 , res .text
474+ assert res .json ["environment" ]["container_image" ] == "nginx:latest"
You can’t perform that action at this time.
0 commit comments