~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Aaron Bentley
  • Date: 2007-07-17 13:27:14 UTC
  • mfrom: (2624 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070717132714-tmzx9khmg9501k51
Merge from bzr.dev

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')