add tests for essex and fix the testing framework

This commit is contained in:
termie 2012-01-31 15:45:00 -08:00
parent 2d2ce8c72e
commit c6e30eb5a1
2 changed files with 15 additions and 3 deletions

View File

@ -197,6 +197,11 @@ class TestCase(unittest.TestCase):
sys.path.insert(0, path)
self._paths.append(path)
def clear_module(self, module):
for x in sys.modules.keys():
if x.startswith(module):
del sys.modules[x]
def assertListEquals(self, actual, expected):
copy = expected[:]
#print expected, actual

View File

@ -41,10 +41,9 @@ class KcMasterTestCase(CompatTestCase):
def setUp(self):
super(KcMasterTestCase, self).setUp()
revdir = test.checkout_vendor(KEYSTONECLIENT_REPO, 'master')
revdir = test.checkout_vendor(*self.get_checkout())
self.add_path(revdir)
from keystoneclient.v2_0 import client as ks_client
reload(ks_client)
self.clear_module('keystoneclient')
self.public_app = self.loadapp('keystone', name='main')
self.admin_app = self.loadapp('keystone', name='admin')
@ -63,6 +62,9 @@ class KcMasterTestCase(CompatTestCase):
self.user_foo['id'], self.tenant_bar['id'],
dict(roles=['keystone_admin'], is_admin='1'))
def get_checkout(self):
return KEYSTONECLIENT_REPO, 'master'
def get_client(self, user_ref=None, tenant_ref=None):
if user_ref is None:
user_ref = self.user_foo
@ -429,3 +431,8 @@ class KcMasterTestCase(CompatTestCase):
# TODO(ja): MEMBERSHIP CRUD
# TODO(ja): determine what else todo
class KcEssex3TestCase(KcMasterTestCase):
def get_checkout(self):
return KEYSTONECLIENT_REPO, 'essex-3'