Fix list_opts test to not check all deps

The list_opts entrypoint test failed unnecessarily when the
dependencies in the packages were inconsistent. This test doesn't
need to verify that the dependencies are consistent, only that the
entrypoint is available and provides the expected function.

Change-Id: I857222e0637b09f45352d9cabbdc5cac8e4fd562
This commit is contained in:
Brant Knudson 2015-05-21 15:56:35 -05:00
parent b069e4382c
commit 03d6f0ce9d
3 changed files with 8 additions and 9 deletions

View File

@ -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
@ -74,12 +74,9 @@ 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
self.assertIsNotNone(result)
self._test_list_auth_token_opts(result)
self._test_list_auth_token_opts(extension.obj)

View File

@ -13,6 +13,7 @@ oslotest>=1.5.1 # Apache-2.0
oslo.messaging>=1.8.0 # Apache-2.0
requests-mock>=0.6.0 # Apache-2.0
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
stevedore>=1.3.0 # Apache-2.0
testrepository>=0.0.18
testresources>=0.2.4
testtools>=0.9.36,!=1.2.0

View File

@ -14,6 +14,7 @@ oslotest>=1.5.1 # Apache-2.0
oslo.messaging>=1.8.0 # Apache-2.0
requests-mock>=0.6.0 # Apache-2.0
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
stevedore>=1.3.0 # Apache-2.0
testrepository>=0.0.18
testresources>=0.2.4
testtools>=0.9.36,!=1.2.0