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: I0bb0f2b591c402202104af8daf07d56b514cbb2f
This commit is contained in:
parent
7bbd6e4769
commit
3d483fda70
@ -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:
|
||||
@ -47,10 +47,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)
|
||||
|
Loading…
Reference in New Issue
Block a user