File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 67
67
from tests .unit_test_support import (
68
68
createClusterWithConfig ,
69
69
createClusterConfig ,
70
+ createClusterWrongType ,
70
71
)
71
72
72
73
import codeflare_sdk .utils .kube_api_helpers
@@ -268,6 +269,11 @@ def test_config_creation():
268
269
assert config .appwrapper == True
269
270
270
271
272
+ def test_config_creation_wrong_type ():
273
+ with pytest .raises (TypeError ):
274
+ config = createClusterWrongType ()
275
+
276
+
271
277
def test_cluster_creation (mocker ):
272
278
# Create AppWrapper containing a Ray Cluster with no local queue specified
273
279
mocker .patch ("kubernetes.client.ApisApi.get_api_versions" )
Original file line number Diff line number Diff line change @@ -31,3 +31,23 @@ def createClusterWithConfig(mocker):
31
31
)
32
32
cluster = Cluster (createClusterConfig ())
33
33
return cluster
34
+
35
+
36
+ def createClusterWrongType ():
37
+ config = ClusterConfiguration (
38
+ name = "unit-test-cluster" ,
39
+ namespace = "ns" ,
40
+ num_workers = 2 ,
41
+ worker_cpu_requests = [],
42
+ worker_cpu_limits = 4 ,
43
+ worker_memory_requests = 5 ,
44
+ worker_memory_limits = 6 ,
45
+ worker_extended_resource_requests = {"nvidia.com/gpu" : 7 },
46
+ appwrapper = True ,
47
+ machine_types = [True , False ],
48
+ image_pull_secrets = ["unit-test-pull-secret" ],
49
+ image = "quay.io/rhoai/ray:2.23.0-py39-cu121" ,
50
+ write_to_file = True ,
51
+ labels = {1 : 1 },
52
+ )
53
+ return config
You can’t perform that action at this time.
0 commit comments