File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 6767from tests .unit_test_support import (
6868 createClusterWithConfig ,
6969 createClusterConfig ,
70+ createClusterWrongType ,
7071)
7172
7273import codeflare_sdk .utils .kube_api_helpers
@@ -268,6 +269,11 @@ def test_config_creation():
268269 assert config .appwrapper == True
269270
270271
272+ def test_config_creation_wrong_type ():
273+ with pytest .raises (TypeError ):
274+ config = createClusterWrongType ()
275+
276+
271277def test_cluster_creation (mocker ):
272278 # Create AppWrapper containing a Ray Cluster with no local queue specified
273279 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):
3131 )
3232 cluster = Cluster (createClusterConfig ())
3333 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