def test__rename_volume_host_missing(self,
cinder_manage_volume_update_host):
self.action_get.return_value = 'myhost'
query_mock = mock.MagicMock()
query_mock.filter().all.return_value = []
cinder.db.sqlalchemy.api.model_query.return_value = query_mock
cinder_manage._rename_volume_host('a', 'b')
self.assertFalse(cinder_manage_volume_update_host.called)
self.action_fail.assert_called_once_with(
'Cannot update host attribute from a, a not found')
test_actions_cinder_manage.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录