'Tests that we fail if trying to use Cinder v1.'

@mock.patch('nova.volume.cinder.cinder_client.get_volume_api_from_url', return_value='1')
def test_cinderclient_unsupported_v1(self, get_api_version):

    self.flags(catalog_info='volume:cinder:publicURL', group='cinder')
    get_endpoint = mock.Mock(return_value='http://localhost:8776/v1/%(project_id)s')
    fake_session = mock.Mock(get_endpoint=get_endpoint)
    ctxt = context.get_admin_context()
    with mock.patch.object(cinder, '_SESSION', fake_session):
        self.assertRaises(exception.UnsupportedCinderAPIVersion, cinder.cinderclient, ctxt)
    get_api_version.assert_called_once_with(get_endpoint.return_value)
