def test_delete_timeout(self, mock_execute):
consts.DESTROY_VOLUME_TIMEOUT = 4
fd, tmpfname = tempfile.mkstemp()
attachments = [{u'server_id': u'123',
u'attachment_id': u'123',
u'attached_at': u'2016-05-20T09:19:57.000000',
u'host_name': utils.get_hostname(),
u'device': None,
u'id': u'123'}]
self.cinderprovider._get_docker_volume = mock.MagicMock()
self.cinderprovider._get_docker_volume.return_value = (
fake_object.FakeCinderVolume(id=tmpfname,
attachments=attachments),
consts.ATTACH_TO_THIS)
self.assertRaises(exceptions.TimeoutException,
self.cinderprovider.delete,
'fake-vol')
评论列表
文章目录