/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Alexander Belchenko
  • Date: 2008-01-21 10:46:32 UTC
  • mto: This revision was merged to the branch mainline in revision 3201.
  • Revision ID: bialix@ukr.net-20080121104632-ipdnpm6z4k5piv3q
show path to plugin module as *.py instead of *.pyc if python source available

(e.g. C:\bzr.dev\bzrlib\plugins\multiparent.py)

Show diffs side-by-side

added added

removed removed

Lines of Context:
273
273
        plugin_path = self.test_dir + '/plugin.py'
274
274
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
275
275
 
 
276
    def test_plugin_get_path_py_not_pyc(self):
 
277
        self.setup_plugin()         # after first import there will be plugin.pyc
 
278
        self.teardown_plugin()
 
279
        bzrlib.plugin.load_from_path(['.']) # import plugin.pyc
 
280
        plugins = bzrlib.plugin.plugins()
 
281
        plugin = plugins['plugin']
 
282
        plugin_path = self.test_dir + '/plugin.py'
 
283
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
 
284
 
 
285
    def test_plugin_get_path_pyc_only(self):
 
286
        self.setup_plugin()         # after first import there will be plugin.pyc
 
287
        self.teardown_plugin()
 
288
        os.unlink(self.test_dir + '/plugin.py')
 
289
        bzrlib.plugin.load_from_path(['.']) # import plugin.pyc
 
290
        plugins = bzrlib.plugin.plugins()
 
291
        plugin = plugins['plugin']
 
292
        if __debug__:
 
293
            plugin_path = self.test_dir + '/plugin.pyc'
 
294
        else:
 
295
            plugin_path = self.test_dir + '/plugin.pyo'
 
296
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
 
297
 
276
298
    def test_no_test_suite_gives_None_for_test_suite(self):
277
299
        self.setup_plugin()
278
300
        plugin = bzrlib.plugin.plugins()['plugin']