keystone/keystone/tests/unit/test_entry_points.py
Morgan Fainberg 18d597f8e8 Internally defined middleware don't use stevedore
For internally defined middleware (URL Normalizer and AuthContext)
Do not use stevedore to load, apply directly. This also cleans up
a lingering entry in the setup.cfg for token_auth.

Test Changes:

* entry points test no longer looks for url_normalize and
build_auth_context

Change-Id: I58d3c23ad4f70668ada4eae94a94d3f5fe750b3b
Partial-Bug: #1776504
2018-10-11 15:27:46 -07:00

34 lines
1.1 KiB
Python

# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 stevedore
from testtools import matchers
from keystone.tests.unit import core as test
class TestEntryPoints(test.TestCase):
def test_entry_point_middleware(self):
"""Assert that our list of expected middleware is present."""
expected_names = [
'cors',
'debug',
'request_id',
'sizelimit',
]
em = stevedore.ExtensionManager('keystone.server_middleware')
actual_names = [extension.name for extension in em]
self.assertThat(actual_names, matchers.ContainsAll(expected_names))