Skip to content

Commit 15c465f

Browse files
author
mhecko
committed
checkrhui(tests): fix tests not mocking api.get_common_folder_path
1 parent ac9e71f commit 15c465f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def create_amazon_id_dnf_plugin_copy_task():
1616

1717

1818
def produce_rhui_info_for_provider(provider):
19+
if not provider:
20+
return
1921
upgrade_path = rhui.get_upg_path()
2022

2123
cloud_map_entry = rhui.RHUI_CLOUD_MAP[upgrade_path][provider]

repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from leapp.libraries.common import rhsm
66
from leapp.libraries.common.config import mock_configs
7+
from leapp.libraries.stdlib import api
78
from leapp.models import (
89
InstalledRedHatSignedRPM,
910
InstalledRPM,
@@ -51,6 +52,7 @@ def test_check_rhui_actor(
5152
monkeypatch, current_actor_context, skip_rhsm, msgs_received, installed_rpms
5253
):
5354
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
55+
monkeypatch.setattr(api, 'get_common_folder_path', lambda dummy: '/commons')
5456

5557
current_actor_context.feed(create_modulesfacts(installed_rpm=installed_rpms))
5658
current_actor_context.run(config_model=mock_configs.CONFIG)

0 commit comments

Comments
 (0)