@@ -52,21 +52,6 @@ def test_create_apps_deployment_from_yaml(self):
5252 name = "nginx-app" , namespace = "default" ,
5353 body = {})
5454
55- def test_create_extensions_deployment_from_yaml (self ):
56- """
57- Should be able to create an extensions/v1beta1 deployment.
58- """
59- k8s_client = client .api_client .ApiClient (configuration = self .config )
60- utils .create_from_yaml (
61- k8s_client , self .path_prefix + "extensions-deployment.yaml" )
62- ext_api = client .ExtensionsV1beta1Api (k8s_client )
63- dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
64- namespace = "default" )
65- self .assertIsNotNone (dep )
66- ext_api .delete_namespaced_deployment (
67- name = "nginx-deployment" , namespace = "default" ,
68- body = {})
69-
7055 def test_create_pod_from_yaml (self ):
7156 """
7257 Should be able to create a pod.
@@ -134,7 +119,7 @@ def test_create_deployment_non_default_namespace_from_yaml(self):
134119 utils .create_from_yaml (
135120 k8s_client , self .path_prefix + "dep-deployment.yaml" )
136121 core_api = client .CoreV1Api (k8s_client )
137- ext_api = client .ExtensionsV1beta1Api (k8s_client )
122+ ext_api = client .AppsV1Api (k8s_client )
138123 nmsp = core_api .read_namespace (name = "dep" )
139124 self .assertIsNotNone (nmsp )
140125 dep = ext_api .read_namespaced_deployment (name = "nginx-deployment" ,
@@ -186,7 +171,7 @@ def test_create_general_list_from_yaml(self):
186171 utils .create_from_yaml (
187172 k8s_client , self .path_prefix + "list.yaml" )
188173 core_api = client .CoreV1Api (k8s_client )
189- ext_api = client .ExtensionsV1beta1Api (k8s_client )
174+ ext_api = client .AppsV1Api (k8s_client )
190175 svc = core_api .read_namespaced_service (name = "list-service-test" ,
191176 namespace = "default" )
192177 self .assertIsNotNone (svc )
@@ -317,7 +302,7 @@ def test_create_from_multi_resource_yaml_with_conflict(self):
317302
318303 def test_create_from_multi_resource_yaml_with_multi_conflicts (self ):
319304 """
320- Should create an extensions/v1beta1 deployment
305+ Should create an apps/v1 deployment
321306 and fail to create the same deployment twice.
322307 Should raise an exception that contains two error messages.
323308 """
@@ -327,14 +312,14 @@ def test_create_from_multi_resource_yaml_with_multi_conflicts(self):
327312 k8s_client , self .path_prefix + "triple-nginx.yaml" )
328313 exp_error = ('Error from server (Conflict): {"kind":"Status",'
329314 '"apiVersion":"v1","metadata":{},"status":"Failure",'
330- '"message":"deployments.extensions \\ "triple-nginx\\ " '
315+ '"message":"deployments.apps \\ "triple-nginx\\ " '
331316 'already exists","reason":"AlreadyExists",'
332- '"details":{"name":"triple-nginx","group":"extensions ",'
317+ '"details":{"name":"triple-nginx","group":"apps ",'
333318 '"kind":"deployments"},"code":409}\n '
334319 )
335320 exp_error += exp_error
336321 self .assertEqual (exp_error , str (cm .exception ))
337- ext_api = client .ExtensionsV1beta1Api (k8s_client )
322+ ext_api = client .AppsV1Api (k8s_client )
338323 dep = ext_api .read_namespaced_deployment (name = "triple-nginx" ,
339324 namespace = "default" )
340325 self .assertIsNotNone (dep )
@@ -348,7 +333,8 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
348333 """
349334 k8s_client = client .api_client .ApiClient (configuration = self .config )
350335 utils .create_from_yaml (
351- k8s_client , self .path_prefix + "apps-deployment.yaml" , namespace = self .test_namespace )
336+ k8s_client , self .path_prefix + "apps-deployment.yaml" ,
337+ namespace = self .test_namespace )
352338 app_api = client .AppsV1beta1Api (k8s_client )
353339 dep = app_api .read_namespaced_deployment (name = "nginx-app" ,
354340 namespace = self .test_namespace )
@@ -357,14 +343,15 @@ def test_create_namespaces_apps_deployment_from_yaml(self):
357343 name = "nginx-app" , namespace = self .test_namespace ,
358344 body = {})
359345
360- def test_create_from_list_in_multi_resource_yaml (self ):
346+ def test_create_from_list_in_multi_resource_yaml_namespaced (self ):
361347 """
362348 Should be able to create the items in the PodList and a deployment
363- specified in the multi-resource file
349+ specified in the multi-resource file in a test namespace
364350 """
365351 k8s_client = client .api_client .ApiClient (configuration = self .config )
366352 utils .create_from_yaml (
367- k8s_client , self .path_prefix + "multi-resource-with-list.yaml" , namespace = self .test_namespace )
353+ k8s_client , self .path_prefix + "multi-resource-with-list.yaml" ,
354+ namespace = self .test_namespace )
368355 core_api = client .CoreV1Api (k8s_client )
369356 app_api = client .AppsV1beta1Api (k8s_client )
370357 pod_0 = core_api .read_namespaced_pod (
0 commit comments