Skip to content

Commit

Permalink
Switch to python-keystoneclient 0.2.3.
Browse files Browse the repository at this point in the history
Fixed the bug #1151665 by having python-keystoneclient dependency to
version >=0.2.3.

Also fixed the issue of setting the fake memory cache for keystone
middleware in unit test by using the correct configuration and request
environment.

Change-Id: Id3706bea6083c03adc46a8716c5cb8074339fc45
  • Loading branch information
lianhao committed Mar 20, 2013
1 parent f2ba3ef commit cf1c2d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ceilometer/tests/api.py
Expand Up @@ -133,7 +133,7 @@ def tearDown(self):
pecan.set_config({}, overwrite=True)

def get_json(self, path, expect_errors=False, headers=None,
q=[], **params):
extra_environ=None, q=[], **params):
full_path = self.PATH_PREFIX + path
query_params = {'q.field': [],
'q.value': [],
Expand All @@ -150,6 +150,7 @@ def get_json(self, path, expect_errors=False, headers=None,
response = self.app.get(full_path,
params=all_params,
headers=headers,
extra_environ=extra_environ,
expect_errors=expect_errors)
if not expect_errors:
response = response.json
Expand Down
16 changes: 15 additions & 1 deletion tests/api/v2/test_acl.py
Expand Up @@ -18,6 +18,10 @@
"""Test ACL."""

import datetime
from oslo.config import cfg

from ceilometer.api import acl
from ceilometer import policy

from .base import FunctionalTest

Expand Down Expand Up @@ -54,9 +58,19 @@ class TestAPIACL(FunctionalTest):

def setUp(self):
super(TestAPIACL, self).setUp()
self.app.app._cache = FakeMemcache()
self.environ = {'fake.cache': FakeMemcache()}

def get_json(self, path, expect_errors=False, headers=None,
q=[], **params):
return super(TestAPIACL, self).get_json(path,
expect_errors=expect_errors,
headers=headers,
q=q,
extra_environ=self.environ,
**params)

def _make_app(self):
cfg.CONF.set_override("cache", "fake.cache", group=acl.OPT_GROUP_NAME)
return super(TestAPIACL, self)._make_app(enable_acl=True)

def test_non_authenticated(self):
Expand Down
5 changes: 1 addition & 4 deletions tools/pip-requires
Expand Up @@ -14,10 +14,7 @@ pecan>=0.2.0
stevedore>=0.7
python-glanceclient
python-novaclient>=2.6.10
# FIXME(llu) Until the latest python-keystoneclient compatible with oslo.config
# is ready on Pypi, we use master for work-around. Bug #1151665.
# python-keystoneclient>=0.2,<0.3
http://tarballs.openstack.org/python-keystoneclient/python-keystoneclient-master.tar.gz#egg=python-keystoneclient
python-keystoneclient>=0.2.3
python-swiftclient
lxml
requests<1.0
Expand Down

0 comments on commit cf1c2d6

Please sign in to comment.