Skip to content

Commit 1d985bb

Browse files
authored
[ISV-4806] - refactor check_replaces_availability test (#645)
1 parent 84e212b commit 1d985bb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

operator-pipeline-images/operatorcert/static_tests/community/bundle.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,13 @@ def check_replaces_availability(bundle: Bundle) -> Iterator[CheckResult]:
375375
return
376376
delimiter = ".v" if ".v" in replaces else "."
377377
replaces_version = replaces.split(delimiter, 1)[1]
378-
replaces_bundle = bundle.operator.bundle(replaces_version)
378+
379+
ver_to_dir = {
380+
x.csv_operator_version: x.operator_version
381+
for x in bundle.operator.all_bundles()
382+
}
383+
replaces_bundle = bundle.operator.bundle(ver_to_dir[replaces_version])
384+
379385
ocp_versions_str = bundle.annotations.get("com.redhat.openshift.versions")
380386
replaces_ocp_version_str = replaces_bundle.annotations.get(
381387
"com.redhat.openshift.versions"

operator-pipeline-images/tests/entrypoints/test_validatecatalog_format.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
@patch("operatorcert.entrypoints.validate_catalog_format.run_command")
1010
def test_validate_catalog_format(mock_run_command: MagicMock) -> None:
11-
1211
validate_catalog_format.validate_catalog_format("path/to/catalogs", "catalog1")
1312

1413
mock_run_command.assert_called_once_with(

0 commit comments

Comments
 (0)