summaryrefslogtreecommitdiffstats
path: root/keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py')
-rw-r--r--keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py b/keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py
index 93e1b06e..9ddb8005 100644
--- a/keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py
+++ b/keystonemiddleware-moon/keystonemiddleware/tests/unit/test_opts.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import pkg_resources
+import stevedore
from testtools import matchers
from keystonemiddleware import opts
@@ -46,6 +46,7 @@ class OptsTestCase(utils.TestCase):
'certfile',
'keyfile',
'cafile',
+ 'region_name',
'insecure',
'signing_dir',
'memcached_servers',
@@ -74,12 +75,12 @@ class OptsTestCase(utils.TestCase):
self._test_list_auth_token_opts(opts.list_auth_token_opts())
def test_entry_point(self):
- result = None
- for ep in pkg_resources.iter_entry_points('oslo.config.opts'):
- if ep.name == 'keystonemiddleware.auth_token':
- list_fn = ep.load()
- result = list_fn()
+ em = stevedore.ExtensionManager('oslo.config.opts',
+ invoke_on_load=True)
+ for extension in em:
+ if extension.name == 'keystonemiddleware.auth_token':
break
+ else:
+ self.fail('keystonemiddleware.auth_token not found')
- self.assertIsNotNone(result)
- self._test_list_auth_token_opts(result)
+ self._test_list_auth_token_opts(extension.obj)