@@ -371,13 +371,13 @@ def test_require_collection_wrong_version(runtime: Runtime) -> None:
371371 "ansible-galaxy" ,
372372 "collection" ,
373373 "install" ,
374- "containers.podman " ,
374+ "examples/reqs_v2/community-molecule-0.1.0.tar.gz " ,
375375 "-p" ,
376376 "~/.ansible/collections" ,
377377 ]
378378 )
379379 with pytest .raises (InvalidPrerequisiteError ) as pytest_wrapped_e :
380- runtime .require_collection ("containers.podman " , "9999.9.9" )
380+ runtime .require_collection ("community.molecule " , "9999.9.9" )
381381 assert pytest_wrapped_e .type == InvalidPrerequisiteError
382382 assert pytest_wrapped_e .value .code == INVALID_PREREQUISITES_RC
383383
@@ -435,22 +435,24 @@ def test_require_collection_missing(
435435
436436def test_install_collection (runtime : Runtime ) -> None :
437437 """Check that valid collection installs do not fail."""
438- runtime .install_collection ("containers.podman:>= 1.0" )
438+ runtime .install_collection ("examples/reqs_v2/community-molecule-0. 1.0.tar.gz " )
439439
440440
441441def test_install_collection_dest (runtime : Runtime , tmp_path : pathlib .Path ) -> None :
442442 """Check that valid collection to custom destination passes."""
443- runtime .install_collection ("containers.podman:>=1.0" , destination = tmp_path )
443+ runtime .install_collection (
444+ "examples/reqs_v2/community-molecule-0.1.0.tar.gz" , destination = tmp_path
445+ )
444446 expected_file = (
445- tmp_path / "ansible_collections" / "containers " / "podman " / "MANIFEST.json"
447+ tmp_path / "ansible_collections" / "community " / "molecule " / "MANIFEST.json"
446448 )
447449 assert expected_file .is_file ()
448450
449451
450452def test_install_collection_fail (runtime : Runtime ) -> None :
451453 """Check that invalid collection install fails."""
452454 with pytest .raises (AnsibleCompatError ) as pytest_wrapped_e :
453- runtime .install_collection ("containers.podman :>=9999.0" )
455+ runtime .install_collection ("community.molecule :>=9999.0" )
454456 assert pytest_wrapped_e .type == InvalidPrerequisiteError
455457 assert pytest_wrapped_e .value .code == INVALID_PREREQUISITES_RC
456458
@@ -560,15 +562,15 @@ def test_upgrade_collection(runtime_tmp: Runtime) -> None:
560562 runtime_tmp .prepare_environment ()
561563
562564 # we install specific oudated version of a collection
563- runtime_tmp .install_collection ("containers.podman:==1.6.0 " )
565+ runtime_tmp .install_collection ("examples/reqs_v2/community-molecule-0.1.0.tar.gz " )
564566 with pytest .raises (
565567 InvalidPrerequisiteError ,
566- match = "Found containers.podman collection 1.6. 0 but 1.6.1 or newer is required." ,
568+ match = "Found community.molecule collection 0.1. 0 but 9.9.9 or newer is required." ,
567569 ):
568570 # we check that when install=False, we raise error
569- runtime_tmp .require_collection ("containers.podman " , "1.6.1 " , install = False )
570- # now we really perform the upgrade
571- runtime_tmp .require_collection ("containers.podman " , "1.6.1 " )
571+ runtime_tmp .require_collection ("community.molecule " , "9.9.9 " , install = False )
572+ # this should not fail, as we have this version
573+ runtime_tmp .require_collection ("community.molecule " , "0.1.0 " )
572574
573575
574576def test_require_collection_no_cache_dir () -> None :
0 commit comments