def test_delete(self, mock_execute):
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.cinderprovider._delete_volume = mock.MagicMock()
self.assertTrue(self.cinderprovider.delete('fake-vol'))
评论列表
文章目录