/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-02-06 13:43:53 UTC
  • mfrom: (3211 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3231.
  • Revision ID: bialix@ukr.net-20080206134353-hmkib323nxgq3tw6
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
        plugin_path = self.test_dir + '/plugin.py'
250
250
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
251
251
 
 
252
    def test_plugin_get_path_py_not_pyc(self):
 
253
        self.setup_plugin()         # after first import there will be plugin.pyc
 
254
        self.teardown_plugin()
 
255
        bzrlib.plugin.load_from_path(['.']) # import plugin.pyc
 
256
        plugins = bzrlib.plugin.plugins()
 
257
        plugin = plugins['plugin']
 
258
        plugin_path = self.test_dir + '/plugin.py'
 
259
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
 
260
 
 
261
    def test_plugin_get_path_pyc_only(self):
 
262
        self.setup_plugin()         # after first import there will be plugin.pyc
 
263
        self.teardown_plugin()
 
264
        os.unlink(self.test_dir + '/plugin.py')
 
265
        bzrlib.plugin.load_from_path(['.']) # import plugin.pyc
 
266
        plugins = bzrlib.plugin.plugins()
 
267
        plugin = plugins['plugin']
 
268
        if __debug__:
 
269
            plugin_path = self.test_dir + '/plugin.pyc'
 
270
        else:
 
271
            plugin_path = self.test_dir + '/plugin.pyo'
 
272
        self.assertIsSameRealPath(plugin_path, normpath(plugin.path()))
 
273
 
252
274
    def test_no_test_suite_gives_None_for_test_suite(self):
253
275
        self.setup_plugin()
254
276
        plugin = bzrlib.plugin.plugins()['plugin']