From fabad5a6604e9e0248ec310e2b808dc06799c34b Mon Sep 17 00:00:00 2001 From: termie Date: Mon, 6 Feb 2012 18:01:08 -0800 Subject: [PATCH] remove novaclient, fix python syntax Change-Id: Ib5c523a5feb74fbc6f4f75ec4d112dbcd23a559c --- tests/test_keystoneclient.py | 3 +- tests/test_novaclient_compat.py | 62 --------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 tests/test_novaclient_compat.py diff --git a/tests/test_keystoneclient.py b/tests/test_keystoneclient.py index a32a3b143c..81d4175263 100644 --- a/tests/test_keystoneclient.py +++ b/tests/test_keystoneclient.py @@ -136,8 +136,7 @@ class KeystoneClientTests(object): # FIXME(dolph): this should raise unauthorized # from keystoneclient import exceptions as client_exceptions # with self.assertRaises(client_exceptions.Unauthorized): - with self.assertRaises(Exception): - token_client.tenants.list() + self.assertRaises(Exception, token_client.tenants.list) # TODO(termie): I'm not really sure that this is testing much def test_endpoints(self): diff --git a/tests/test_novaclient_compat.py b/tests/test_novaclient_compat.py deleted file mode 100644 index 5578e4f784..0000000000 --- a/tests/test_novaclient_compat.py +++ /dev/null @@ -1,62 +0,0 @@ -import copy -import json -import os -import sys - -from keystone import config -from keystone import test -from keystone.common import logging -from keystone.common import utils - -import default_fixtures - - -CONF = config.CONF -OPENSTACK_REPO = 'https://review.openstack.org/p/openstack' -NOVACLIENT_REPO = '%s/python-novaclient.git' % OPENSTACK_REPO - - -class CompatTestCase(test.TestCase): - def setUp(self): - super(CompatTestCase, self).setUp() - - -class NovaClientCompatMasterTestCase(CompatTestCase): - def setUp(self): - super(NovaClientCompatMasterTestCase, self).setUp() - - revdir = test.checkout_vendor(NOVACLIENT_REPO, 'master') - self.add_path(revdir) - from novaclient.keystone import client as ks_client - from novaclient import client as base_client - reload(ks_client) - reload(base_client) - - CONF(config_files=[test.etcdir('keystone.conf'), - test.testsdir('test_overrides.conf')]) - self.app = self.loadapp('keystone') - self.load_backends() - self.load_fixtures(default_fixtures) - self.server = self.serveapp('keystone') - - def test_authenticate_and_tenants(self): - from novaclient.keystone import client as ks_client - from novaclient import client as base_client - - port = self.server.socket_info['socket'][1] - CONF.public_port = port - - # NOTE(termie): novaclient wants a "/" TypeErrorat the end, keystoneclient does not - # NOTE(termie): projectid is apparently sent as tenantName, so... that's - # unfortunate. - # NOTE(termie): novaclient seems to care about the region more than - # keystoneclient - conn = base_client.HTTPClient(auth_url="http://localhost:%s/v2.0/" % port, - user='FOO', - password='foo2', - projectid='BAR', - region_name='RegionOne') - client = ks_client.Client(conn) - client.authenticate() - # NOTE(termie): novaclient doesn't know about tenants or anything like that - # so just test that we can validate