OpenStack Identity (Keystone) Middleware
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.8 KiB

# Copyright (c) 2014 OpenStack Foundation.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pkg_resources
from testtools import matchers
from keystonemiddleware import opts
from keystonemiddleware.tests import utils
class OptsTestCase(utils.TestCase):
def _test_list_auth_token_opts(self, result):
self.assertThat(result, matchers.HasLength(1))
for group in (g for (g, _l) in result):
self.assertEqual('keystone_authtoken', group)
expected_opt_names = [
opt_names = [ for (g, l) in result for o in l]
self.assertThat(opt_names, matchers.HasLength(len(expected_opt_names)))
for opt in opt_names:
self.assertIn(opt, expected_opt_names)
def test_list_auth_token_opts(self):
def test_entry_point(self):
result = None
for ep in pkg_resources.iter_entry_points('oslo.config.opts'):
if == 'keystonemiddleware.auth_token':
list_fn = ep.load()
result = list_fn()