Skip to content

Commit 1f387ef

Browse files
committed
Fix unit tests
1 parent c7472dc commit 1f387ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/unit/plugins/module_utils/test_cluster.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from ansible_collections.scale_computing.hypercore.plugins.module_utils.cluster import (
1010
Cluster,
1111
)
12+
from ansible_collections.scale_computing.hypercore.plugins.module_utils.errors import (
13+
ScaleTimeoutError,
14+
)
1215
from ansible_collections.scale_computing.hypercore.plugins.module_utils.utils import (
1316
MIN_PYTHON_VERSION,
1417
)
@@ -111,6 +114,8 @@ def test_cluster_update_name(self, rest_client):
111114

112115
def test_cluster_shutdown(self, rest_client):
113116
force_shutdown = True
117+
rest_client.create_record.side_effect = ScaleTimeoutError("Timeout error")
118+
rest_client.get_record.side_effect = ConnectionRefusedError
114119

115120
Cluster.shutdown(rest_client, force_shutdown)
116121

@@ -121,6 +126,9 @@ def test_cluster_shutdown(self, rest_client):
121126
)
122127

123128
def test_cluster_shutdown_default_force_shutdown(self, rest_client):
129+
rest_client.create_record.side_effect = ScaleTimeoutError("Timeout error")
130+
rest_client.get_record.side_effect = ConnectionRefusedError
131+
124132
Cluster.shutdown(rest_client)
125133

126134
rest_client.create_record.assert_called_with(

0 commit comments

Comments
 (0)