From fa8ccc766f2266c39a1a610a26706b295debe7d4 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 20 Apr 2018 03:52:04 +0000 Subject: [PATCH] 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 --- zun/tests/unit/api/controllers/v1/test_containers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zun/tests/unit/api/controllers/v1/test_containers.py b/zun/tests/unit/api/controllers/v1/test_containers.py index a4192f5be..272a0d58d 100644 --- a/zun/tests/unit/api/controllers/v1/test_containers.py +++ b/zun/tests/unit/api/controllers/v1/test_containers.py @@ -1590,6 +1590,7 @@ class TestContainerController(api_base.FunctionalTest): test_container = utils.get_test_container() test_container_obj = objects.Container(self.context, **test_container) mock_get_resource.return_value = test_container_obj + mock_exec_resize.return_value = None container_name = test_container.get('name') url = '/v1/containers/%s/%s/' % (container_name, 'execute_resize') fake_exec_id = ('7df36611fa1fc855618c2c643835d41d'