@patch.object(OpenStackCloud, 'cinder_client')
    def test_create_volume_snapshot_with_error(self, mock_cinder):
        build_snapshot = fakes.FakeVolumeSnapshot('1234', 'creating',
                                                  'bar', 'derpysnapshot')
        error_snapshot = fakes.FakeVolumeSnapshot('1234', 'error',
                                                  'blah', 'derpysnapshot')

        mock_cinder.volume_snapshots.create.return_value = build_snapshot
        mock_cinder.volume_snapshots.get.return_value = error_snapshot
        mock_cinder.volume_snapshots.list.return_value = [error_snapshot]

        self.assertRaises(
            OpenStackCloudException,
            self.client.create_volume_snapshot, volume_id='1234',
            wait=True, timeout=5)

        mock_cinder.volume_snapshots.create.assert_called_with(
            force=False, volume_id='1234'
        )
        mock_cinder.volume_snapshots.get.assert_called_with(
            snapshot_id=meta.obj_to_dict(build_snapshot)['id']
        )
Test that a error status while waiting for the volume snapshot to
dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_create_volume_snapshot.py/TestCreateVolumeSnapshot.test_create_volume_snapshot_with_error