'Create/Delete snapshot test.'

@mock.patch.object(requests, 'request', FakeRequests)
def test_create_destroy_snapshot(self):

    volume = {'name': 'test_volume_01', 'size': 1}
    snapshot = {'name': 'snap_01', 'volume_name': volume['name']}
    self.driver.create_volume(volume)
    self.assertRaises(exception.VolumeDriverException, self.driver.create_snapshot, {'name': snapshot['name'], 'volume_name': 'wrong_vol'})
    self.driver.create_snapshot(snapshot)
    self.driver.delete_snapshot({'name': snapshot['name'], 'volume_name': 'wrong_vol'})
    self.driver.delete_snapshot({'name': 'wrong_snap', 'volume_name': volume['name']})
    self.driver.delete_snapshot(snapshot)
    self.driver.delete_volume(volume)
