@@ -105,17 +105,15 @@ def test_service_apis(self):
105105 self .assertEqual ('frontend' , resp .metadata .name )
106106 self .assertTrue (resp .status )
107107
108- # TODO(dims) : Fails with "json: cannot unmarshal object into
109- # Go value of type jsonpatch.Patch"
110- # service_manifest['spec']['ports'] = [{'name': 'new',
111- # 'port': 8080,
112- # 'protocol': 'TCP',
113- # 'targetPort': 8080}]
114- # resp = api.patch_namespaced_service(body=service_manifest,
115- # name='frontend',
116- # namespace='default')
117- # self.assertEqual(2, len(resp.spec.ports))
118- # self.assertTrue(resp.status)
108+ service_manifest ['spec' ]['ports' ] = [{'name' : 'new' ,
109+ 'port' : 8080 ,
110+ 'protocol' : 'TCP' ,
111+ 'targetPort' : 8080 }]
112+ resp = api .patch_namespaced_service (body = service_manifest ,
113+ name = 'frontend' ,
114+ namespace = 'default' )
115+ self .assertEqual (2 , len (resp .spec .ports ))
116+ self .assertTrue (resp .status )
119117
120118 resp = api .delete_namespaced_service (name = 'frontend' ,
121119 namespace = 'default' )
@@ -182,11 +180,9 @@ def test_configmap_apis(self):
182180 name = 'test-configmap' , namespace = 'default' )
183181 self .assertEqual ('test-configmap' , resp .metadata .name )
184182
185- # TODO(dims): Fails with "json: cannot unmarshal object
186- # into Go value of type jsonpatch.Patch"
187- # test_configmap['data']['config.json'] = "{}"
188- # resp = api.patch_namespaced_config_map(
189- # name='test-configmap', namespace='default', body=test_configmap)
183+ test_configmap ['data' ]['config.json' ] = "{}"
184+ resp = api .patch_namespaced_config_map (
185+ name = 'test-configmap' , namespace = 'default' , body = test_configmap )
190186
191187 resp = api .delete_namespaced_config_map (
192188 name = 'test-configmap' , body = {}, namespace = 'default' )
0 commit comments