@@ -162,7 +162,7 @@ def test_response_data_types_converted(self):
162162 'app' : 'test' ,
163163 'values' : {'PORT' : '5000' },
164164 'memory' : {},
165- 'cpu' : {'web' : 1024 },
165+ 'cpu' : {'web' : " 1024" },
166166 'tags' : {}
167167 }
168168 self .assertDictContainsSubset (expected , response .data )
@@ -171,7 +171,7 @@ def test_response_data_types_converted(self):
171171 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' ,
172172 HTTP_AUTHORIZATION = 'token {}' .format (self .token ))
173173 self .assertEqual (response .status_code , 400 )
174- self .assertIn ('CPU shares must be an integer ' , response .data ['cpu' ])
174+ self .assertIn ('CPU shares must be a numeric value ' , response .data ['cpu' ])
175175
176176 @mock .patch ('requests.post' , mock_status_ok )
177177 def test_config_set_same_key (self ):
@@ -409,7 +409,7 @@ def test_limit_cpu(self):
409409 self .assertIn ('cpu' , response .data )
410410 cpu = response .data ['cpu' ]
411411 self .assertIn ('web' , cpu )
412- self .assertEqual (cpu ['web' ], 1024 )
412+ self .assertEqual (cpu ['web' ], ' 1024' )
413413 # set an additional value
414414 body = {'cpu' : json .dumps ({'worker' : '512' })}
415415 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' ,
@@ -419,19 +419,19 @@ def test_limit_cpu(self):
419419 self .assertNotEqual (limit1 ['uuid' ], limit2 ['uuid' ])
420420 cpu = response .data ['cpu' ]
421421 self .assertIn ('worker' , cpu )
422- self .assertEqual (cpu ['worker' ], 512 )
422+ self .assertEqual (cpu ['worker' ], ' 512' )
423423 self .assertIn ('web' , cpu )
424- self .assertEqual (cpu ['web' ], 1024 )
424+ self .assertEqual (cpu ['web' ], ' 1024' )
425425 # read the limit again
426426 response = self .client .get (url , HTTP_AUTHORIZATION = 'token {}' .format (self .token ))
427427 self .assertEqual (response .status_code , 200 )
428428 limit3 = response .data
429429 self .assertEqual (limit2 , limit3 )
430430 cpu = response .data ['cpu' ]
431431 self .assertIn ('worker' , cpu )
432- self .assertEqual (cpu ['worker' ], 512 )
432+ self .assertEqual (cpu ['worker' ], ' 512' )
433433 self .assertIn ('web' , cpu )
434- self .assertEqual (cpu ['web' ], 1024 )
434+ self .assertEqual (cpu ['web' ], ' 1024' )
435435 # unset a value
436436 body = {'memory' : json .dumps ({'worker' : None })}
437437 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' ,
0 commit comments