Fix unit test failure with pecan 1.3

Pecan has been updated to 1.3 [1] which failed the unit test.
The failure is due to the deserialization of mock object
(see https://review.openstack.org/#/c/561825/ for details) but
the controller should return None instead of a mock object.

[1] https://review.openstack.org/#/c/555891/
[2] https://review.openstack.org/#/c/561825/

Change-Id: I6823d833df7aa363fe00b30189ff3024dc4181cd
Closes-Bug: #1754978
This commit is contained in:
Hongbin Lu 2018-04-20 03:52:04 +00:00
parent 3d3580fe39
commit fa8ccc766f

View File

@ -1590,6 +1590,7 @@ class TestContainerController(api_base.FunctionalTest):
test_container = utils.get_test_container() test_container = utils.get_test_container()
test_container_obj = objects.Container(self.context, **test_container) test_container_obj = objects.Container(self.context, **test_container)
mock_get_resource.return_value = test_container_obj mock_get_resource.return_value = test_container_obj
mock_exec_resize.return_value = None
container_name = test_container.get('name') container_name = test_container.get('name')
url = '/v1/containers/%s/%s/' % (container_name, 'execute_resize') url = '/v1/containers/%s/%s/' % (container_name, 'execute_resize')
fake_exec_id = ('7df36611fa1fc855618c2c643835d41d' fake_exec_id = ('7df36611fa1fc855618c2c643835d41d'