Add test for container_update

Change-Id: I37ac313e8b35f92225e992892c5708774184f94d
This commit is contained in:
Feng Shengqin 2018-08-27 09:12:39 +08:00
parent 8d104b327f
commit c2d7829ec5

View File

@ -1095,6 +1095,14 @@ class TestManager(base.TestCase):
self.compute_manager.container_update,
self.context, container, {})
@mock.patch.object(fake_driver, 'update')
def test_container_update_failed_resources(self, mock_update):
container = Container(self.context, **utils.get_test_container())
mock_update.side_effect = exception.ResourcesUnavailable
self.assertRaises(exception.ResourcesUnavailable,
self.compute_manager.container_update,
self.context, container, {})
@mock.patch.object(fake_driver, 'get_websocket_url')
@mock.patch.object(Container, 'save')
def test_container_attach_successful(self, mock_save,