@@ -105,17 +105,15 @@ def test_service_apis(self):
105
105
self .assertEqual ('frontend' , resp .metadata .name )
106
106
self .assertTrue (resp .status )
107
107
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 )
119
117
120
118
resp = api .delete_namespaced_service (name = 'frontend' ,
121
119
namespace = 'default' )
@@ -182,11 +180,9 @@ def test_configmap_apis(self):
182
180
name = 'test-configmap' , namespace = 'default' )
183
181
self .assertEqual ('test-configmap' , resp .metadata .name )
184
182
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 )
190
186
191
187
resp = api .delete_namespaced_config_map (
192
188
name = 'test-configmap' , body = {}, namespace = 'default' )
0 commit comments