/usr/lib/python2.6/site-packages/stevedore/tests
NameSizeModeActions
extension_unimportable.py00644editdlrm
extension_unimportable.pyc1600644editdlrm
manager.py20340644editdlrm
manager.pyc23870644editdlrm
test_callback.py9260644editdlrm
test_callback.pyc15450644editdlrm
test_dispatch.py35900644editdlrm
test_dispatch.pyc48850644editdlrm
test_driver.py26280644editdlrm
test_driver.pyc36680644editdlrm
test_enabled.py9490644editdlrm
test_enabled.pyc17870644editdlrm
test_example_fields.py7940644editdlrm
test_example_fields.pyc14720644editdlrm
test_example_simple.py4170644editdlrm
test_example_simple.pyc10080644editdlrm
test_extension.py78040644editdlrm
test_extension.pyc114860644editdlrm
test_hook.py11580644editdlrm
test_hook.pyc18550644editdlrm
test_named.py20700644editdlrm
test_named.pyc20460644editdlrm
test_sphinxext.py40500644editdlrm
test_sphinxext.pyc50390644editdlrm
test_test_manager.py89150644editdlrm
test_test_manager.pyc119740644editdlrm
utils.py900644editdlrm
utils.pyc4320644editdlrm
__init__.py00644editdlrm
__init__.pyc1460644editdlrm
Edit: /usr/lib/python2.6/site-packages/stevedore/tests/test_named.py (2070B)
from stevedore import named from stevedore.tests import utils import mock class TestNamed(utils.TestCase): def test_named(self): em = named.NamedExtensionManager( 'stevedore.test.extension', names=['t1'], invoke_on_load=True, invoke_args=('a',), invoke_kwds={'b': 'B'}, ) actual = em.names() self.assertEqual(actual, ['t1']) def test_enabled_before_load(self): # Set up the constructor for the FauxExtension to cause an # AssertionError so the test fails if the class is instantiated, # which should only happen if it is loaded before the name of the # extension is compared against the names that should be loaded by # the manager. init_name = 'stevedore.tests.test_extension.FauxExtension.__init__' with mock.patch(init_name) as m: m.side_effect = AssertionError em = named.NamedExtensionManager( 'stevedore.test.extension', # Look for an extension that does not exist so the # __init__ we mocked should never be invoked. names=['no-such-extension'], invoke_on_load=True, invoke_args=('a',), invoke_kwds={'b': 'B'}, ) actual = em.names() self.assertEqual(actual, []) def test_extensions_listed_in_name_order(self): # Since we don't know the "natural" order of the extensions, run # the test both ways: if the sorting is broken, one of them will # fail em = named.NamedExtensionManager( 'stevedore.test.extension', names=['t1', 't2'], name_order=True ) actual = em.names() self.assertEqual(actual, ['t1', 't2']) em = named.NamedExtensionManager( 'stevedore.test.extension', names=['t2', 't1'], name_order=True ) actual = em.names() self.assertEqual(actual, ['t2', 't1'])