summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Sergeyev <vsergeyev@mirantis.com>2015-05-22 16:08:59 +0300
committerVictor Sergeyev <vsergeyev@mirantis.com>2015-08-21 12:15:20 +0300
commitadbd7c5567c02706fdd2b78d7c84934c84b95dcb (patch)
tree90b600204f76a6bbbb4d70586fedb5e850cfe9e8
parentb6b6edca4672cd5a6570c79f0480af286af09386 (diff)
downloadoslo-messaging-adbd7c5567c02706fdd2b78d7c84934c84b95dcb.tar.gz
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. Cherry-Picked from: 3d483fda709d2d04db2222e0119eaa54de5f5867 Change-Id: Ied173cdc7d0095f0e4960969f729794208e494a5
-rw-r--r--tests/test_opts.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_opts.py b/tests/test_opts.py
index f8dec16..4625591 100644
--- a/tests/test_opts.py
+++ b/tests/test_opts.py
@@ -12,7 +12,7 @@
# 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
+import stevedore
import testtools
try:
@@ -44,10 +44,10 @@ class OptsTestCase(test_utils.BaseTestCase):
def test_entry_point(self):
result = None
- for ep in pkg_resources.iter_entry_points('oslo.config.opts'):
- if ep.name == "oslo.messaging":
- list_fn = ep.load()
- result = list_fn()
+ for ext in stevedore.ExtensionManager('oslo.config.opts',
+ invoke_on_load=True):
+ if ext.name == "oslo.messaging":
+ result = ext.obj
break
self.assertIsNotNone(result)