~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-23 08:51:52 UTC
  • mfrom: (5131.2.6 support_OO_flag)
  • mto: This revision was merged to the branch mainline in revision 5179.
  • Revision ID: v.ladeuil+lp@free.fr-20100423085152-uoewc1vnkwqhw0pj
Manually assign docstrings to command objects, so that they work with python -OO

Show diffs side-by-side

added added

removed removed

Lines of Context:
473
473
        f.write("""\
474
474
from bzrlib import commands
475
475
class cmd_myplug(commands.Command):
476
 
    '''Just a simple test plugin.'''
 
476
    __doc__ = '''Just a simple test plugin.'''
477
477
    aliases = ['mplg']
478
478
    def run(self):
479
479
        print 'Hello from my plugin'
780
780
        self.overrideAttr(plugin, '_loaded', False)
781
781
        plugin.load_plugins(['.'])
782
782
        self.assertPluginKnown('test_foo')
783
 
        self.assertEqual("This is the doc for test_foo",
784
 
                         bzrlib.plugins.test_foo.__doc__)
 
783
        self.assertDocstring("This is the doc for test_foo",
 
784
                             bzrlib.plugins.test_foo)
785
785
 
786
786
    def test_not_loaded(self):
787
787
        self.warnings = []
816
816
 
817
817
    def assertTestFooLoadedFrom(self, path):
818
818
        self.assertPluginKnown('test_foo')
819
 
        self.assertEqual('This is the doc for test_foo',
820
 
                         bzrlib.plugins.test_foo.__doc__)
 
819
        self.assertDocstring('This is the doc for test_foo',
 
820
                             bzrlib.plugins.test_foo)
821
821
        self.assertEqual(path, bzrlib.plugins.test_foo.dir_source)
822
822
 
823
823
    def test_regular_load(self):