@@ -252,7 +252,6 @@ def test_config_creation():
252
252
assert config .dispatch_priority == None
253
253
assert config .mcad == True
254
254
assert config .local_interactive == False
255
-
256
255
257
256
258
257
def test_cluster_creation (mocker ):
@@ -262,7 +261,8 @@ def test_cluster_creation(mocker):
262
261
assert filecmp .cmp (
263
262
"unit-test-cluster.yaml" , f"{ parent } /tests/test-case.yaml" , shallow = True
264
263
)
265
-
264
+
265
+
266
266
def test_create_app_wrapper_raises_error_with_no_image ():
267
267
config = createClusterConfig ()
268
268
config .image = "" # Clear the image to test error handling
@@ -271,8 +271,9 @@ def test_create_app_wrapper_raises_error_with_no_image():
271
271
cluster .create_app_wrapper ()
272
272
assert False , "Expected ValueError when 'image' is not specified."
273
273
except ValueError as error :
274
- assert str (error ) == "Image must be specified in the ClusterConfiguration" , \
275
- "Error message did not match expected output."
274
+ assert (
275
+ str (error ) == "Image must be specified in the ClusterConfiguration"
276
+ ), "Error message did not match expected output."
276
277
277
278
278
279
def test_cluster_creation_no_mcad (mocker ):
@@ -748,7 +749,13 @@ def test_ray_details(mocker, capsys):
748
749
"codeflare_sdk.cluster.cluster.Cluster.cluster_dashboard_uri" ,
749
750
return_value = "" ,
750
751
)
751
- cf = Cluster (ClusterConfiguration (name = "raytest2" , namespace = "ns" , image = "quay.io/project-codeflare/ray:latest-py39-cu118" ))
752
+ cf = Cluster (
753
+ ClusterConfiguration (
754
+ name = "raytest2" ,
755
+ namespace = "ns" ,
756
+ image = "quay.io/project-codeflare/ray:latest-py39-cu118" ,
757
+ )
758
+ )
752
759
captured = capsys .readouterr ()
753
760
ray2 = _copy_to_ray (cf )
754
761
details = cf .details ()
@@ -1914,7 +1921,13 @@ def test_cluster_status(mocker):
1914
1921
head_mem = 8 ,
1915
1922
head_gpu = 0 ,
1916
1923
)
1917
- cf = Cluster (ClusterConfiguration (name = "test" , namespace = "ns" , image = "quay.io/project-codeflare/ray:latest-py39-cu118" ))
1924
+ cf = Cluster (
1925
+ ClusterConfiguration (
1926
+ name = "test" ,
1927
+ namespace = "ns" ,
1928
+ image = "quay.io/project-codeflare/ray:latest-py39-cu118" ,
1929
+ )
1930
+ )
1918
1931
mocker .patch ("codeflare_sdk.cluster.cluster._app_wrapper_status" , return_value = None )
1919
1932
mocker .patch ("codeflare_sdk.cluster.cluster._ray_cluster_status" , return_value = None )
1920
1933
status , ready = cf .status ()
@@ -2004,7 +2017,13 @@ def test_wait_ready(mocker, capsys):
2004
2017
mock_response = mocker .Mock ()
2005
2018
mock_response .status_code = 200
2006
2019
mocker .patch ("requests.get" , return_value = mock_response )
2007
- cf = Cluster (ClusterConfiguration (name = "test" , namespace = "ns" , image = "quay.io/project-codeflare/ray:latest-py39-cu118" ))
2020
+ cf = Cluster (
2021
+ ClusterConfiguration (
2022
+ name = "test" ,
2023
+ namespace = "ns" ,
2024
+ image = "quay.io/project-codeflare/ray:latest-py39-cu118" ,
2025
+ )
2026
+ )
2008
2027
try :
2009
2028
cf .wait_ready (timeout = 5 )
2010
2029
assert 1 == 0
@@ -2669,7 +2688,13 @@ def test_gen_app_wrapper_with_oauth(mocker: MockerFixture):
2669
2688
mocker .patch (
2670
2689
"codeflare_sdk.utils.generate_yaml.write_user_appwrapper" , write_user_appwrapper
2671
2690
)
2672
- Cluster (ClusterConfiguration ("test_cluster" , openshift_oauth = True , image = "quay.io/project-codeflare/ray:latest-py39-cu118" ))
2691
+ Cluster (
2692
+ ClusterConfiguration (
2693
+ "test_cluster" ,
2694
+ openshift_oauth = True ,
2695
+ image = "quay.io/project-codeflare/ray:latest-py39-cu118" ,
2696
+ )
2697
+ )
2673
2698
user_yaml = write_user_appwrapper .call_args .args [0 ]
2674
2699
assert any (
2675
2700
container ["name" ] == "oauth-proxy"
0 commit comments