~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-15 11:24:18 UTC
  • mfrom: (2617 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070715112418-9nn4n6esxv60ny4b
merge bzr.dev@1617

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
    def check_plugin_load(self, zip_name, plugin_name):
209
209
        self.assertFalse(plugin_name in dir(bzrlib.plugins),
210
210
                         'Plugin already loaded')
 
211
        old_path = bzrlib.plugins.__path__
211
212
        try:
 
213
            # this is normally done by load_plugins -> set_plugins_path
 
214
            bzrlib.plugins.__path__ = [zip_name]
212
215
            bzrlib.plugin.load_from_zip(zip_name)
213
216
            self.assertTrue(plugin_name in dir(bzrlib.plugins),
214
217
                            'Plugin is not loaded')
216
219
            # unregister plugin
217
220
            if getattr(bzrlib.plugins, plugin_name, None):
218
221
                delattr(bzrlib.plugins, plugin_name)
 
222
                del sys.modules['bzrlib.plugins.' + plugin_name]
 
223
            bzrlib.plugins.__path__ = old_path
219
224
 
220
225
    def test_load_module(self):
221
226
        self.make_zipped_plugin('./test.zip', 'ziplug.py')