Skip to content

Commit

Permalink
fix functional test cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ricolin authored and okozachenko1203 committed Nov 28, 2024
1 parent ab03d56 commit acc8bc0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions magnum_cluster_api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def mock_osc(session_mocker, image):
)
)

# Nova

mock_nova_client = mock_clients.nova.return_value
mock_nova_client.server_groups.create.return_value = (
openstack.compute.v2.server_group.ServerGroup(id=uuidutils.generate_uuid())
)
# Glance
mock_glance_client = mock_clients.glance.return_value
mock_glance_client.images.get.return_value = image
Expand Down Expand Up @@ -273,3 +279,11 @@ def server_side_apply_matcher():
"force": "True",
}
)


@pytest.fixture(scope="session")
def mock_cache(session_mocker):
session_mocker.patch(
"magnum_cluster_api.cache.ServerGroupCache.get", return_value=None
)
session_mocker.patch("magnum_cluster_api.cache.ServerGroupCache.set")
1 change: 1 addition & 0 deletions magnum_cluster_api/tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def cluster(
mock_validate_cluster,
mock_osc,
mock_certificates,
mock_cache,
):
try:
ubuntu_driver.create_cluster(context, cluster_obj, 60)
Expand Down

0 comments on commit acc8bc0

Please sign in to comment.