@@ -354,7 +354,9 @@ def test_script_creator_notebook_config():
354354def test_script_creator_notebook_config_http (httpserver ):
355355 http_path = "/mynotebook.ipynb"
356356 nb_path = pathlib .Path (__file__ ).parent / "data" / "paramtest.ipynb"
357- httpserver .expect_request (http_path ).respond_with_data (nb_path .read_bytes ())
357+ httpserver .expect_request (http_path ).respond_with_data (
358+ nb_path .read_bytes ()
359+ )
358360 script_creator = ScriptCreator (httpserver .url_for (http_path ))
359361 config = script_creator .nb_params .config
360362 assert config ["environment_file" ] == "my-environment.yml"
@@ -382,12 +384,20 @@ def test_image_builder_write_dockerfile(tmp_path):
382384@patch ("docker.from_env" )
383385@pytest .mark .parametrize ("env_type" , ["none" , "local" , "http" ])
384386@pytest .mark .parametrize ("skip_build" , [False , True ])
387+ @pytest .mark .parametrize ("with_eoap" , [False , True ])
388+ @pytest .mark .parametrize ("with_xcube" , [False , True ])
389+ @pytest .mark .parametrize ("pystac_in_deps" , [False , True ])
390+ @pytest .mark .parametrize ("xcube_in_deps" , [False , True ])
385391def test_image_builder_build_dir (
386- from_env_mock ,
387- tmp_path ,
388- httpserver ,
389- env_type ,
390- skip_build
392+ from_env_mock ,
393+ tmp_path ,
394+ httpserver ,
395+ env_type ,
396+ skip_build ,
397+ with_eoap ,
398+ with_xcube ,
399+ pystac_in_deps ,
400+ xcube_in_deps ,
391401):
392402 client_mock = Mock (docker .client .DockerClient )
393403 client_mock .images .build .return_value = None , None
@@ -398,16 +408,22 @@ def test_image_builder_build_dir(
398408 env_def = {
399409 "name" : "foo" ,
400410 "channels" : "bar" ,
401- "dependencies" : ["python >=3.13" , "baz >=42.0" ],
411+ "dependencies" : ["python >=3.13" , "baz >=42.0" ]
412+ + (["pystac" ] if pystac_in_deps else [])
413+ + (["xcube" ] if xcube_in_deps else []),
402414 }
403415 build_env_path .write_text (yaml .safe_dump (env_def ))
404416 env_http = "/env2.yaml"
405417
406418 match env_type :
407- case "none" : env_param = None
408- case "local" : env_param = build_env_path
419+ case "none" :
420+ env_param = None
421+ case "local" :
422+ env_param = build_env_path
409423 case "http" :
410- httpserver .expect_request (env_http ).respond_with_data (build_env_path .read_bytes ())
424+ httpserver .expect_request (env_http ).respond_with_data (
425+ build_env_path .read_bytes ()
426+ )
411427 env_param = httpserver .url_for (env_http )
412428 case _:
413429 raise RuntimeError (f"Unknown env type { env_type } " )
@@ -418,7 +434,9 @@ def test_image_builder_build_dir(
418434 build_dir ,
419435 None ,
420436 )
421- image_builder .build (skip_build = skip_build )
437+ image_builder .build (
438+ skip_build = skip_build , with_eoap = with_eoap , with_xcube = with_xcube
439+ )
422440 if skip_build :
423441 from_env_mock .assert_not_called ()
424442 else :
@@ -430,7 +448,12 @@ def test_image_builder_build_dir(
430448 if env_type != "none" :
431449 assert output_env ["name" ] == env_def ["name" ]
432450 assert output_env ["channels" ] == env_def ["channels" ]
433- assert set (output_env ["dependencies" ]) >= set (env_def ["dependencies" ])
451+
452+ output_deps = set (output_env ["dependencies" ])
453+ input_deps = set (env_def ["dependencies" ])
454+ assert output_deps >= input_deps
455+ assert ("pystac" in output_deps ) == pystac_in_deps or with_eoap
456+ assert ("xcube" in output_deps ) == xcube_in_deps or with_xcube
434457
435458 cwl = image_builder .create_cwl ()
436459 assert "cwlVersion" in cwl
0 commit comments