Skip to content

Commit 71b70c0

Browse files
committed
fix: unit tests
1 parent e3619de commit 71b70c0

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

tests/unit_test.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ def test_raycluster_details_cli(mocker):
242242
"kubernetes.client.CustomObjectsApi.list_namespaced_custom_object",
243243
side_effect=get_ray_obj,
244244
)
245-
mocker.patch(
246-
"codeflare_sdk.cluster.cluster.get_current_namespace",
247-
return_value="ns",
248-
)
249245
mocker.patch(
250246
"codeflare_sdk.cluster.cluster.Cluster.status",
251247
return_value=(False, CodeFlareClusterStatus.UNKNOWN),
@@ -282,18 +278,6 @@ def test_raycluster_details_cli(mocker):
282278

283279
def test_raycluster_status_cli(mocker):
284280
runner = CliRunner()
285-
test_raycluster = RayCluster(
286-
"quicktest",
287-
RayClusterStatus.READY,
288-
1,
289-
1,
290-
"1",
291-
"1",
292-
1,
293-
1,
294-
"default",
295-
"dashboard-url",
296-
)
297281
mocker.patch(
298282
"kubernetes.client.CustomObjectsApi.list_namespaced_custom_object",
299283
side_effect=get_ray_obj,
@@ -306,6 +290,19 @@ def test_raycluster_status_cli(mocker):
306290
"codeflare_sdk.cluster.cluster.Cluster.cluster_dashboard_uri",
307291
return_value="",
308292
)
293+
mocker.patch.object(client, "ApiClient")
294+
test_raycluster = RayCluster(
295+
"quicktest",
296+
RayClusterStatus.READY,
297+
1,
298+
1,
299+
"1",
300+
"1",
301+
1,
302+
1,
303+
"default",
304+
"dashboard-url",
305+
)
309306
mocker.patch(
310307
"codeflare_sdk.cluster.cluster._app_wrapper_status",
311308
return_value=test_raycluster,
@@ -314,7 +311,6 @@ def test_raycluster_status_cli(mocker):
314311
"codeflare_sdk.cluster.cluster._ray_cluster_status",
315312
return_value=test_raycluster,
316313
)
317-
mocker.patch.object(client, "ApiClient")
318314
raycluster_status_command = """
319315
status raycluster quicktest
320316
"""

0 commit comments

Comments
 (0)