/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: Martin Pool
  • Date: 2011-01-20 01:02:34 UTC
  • mto: This revision was merged to the branch mainline in revision 5630.
  • Revision ID: mbp@canonical.com-20110120010234-byzvq1zbf7800qha
Additional tests and fixes for refactored describe_plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
965
965
class TestDescribePlugins(BaseTestPlugins):
966
966
 
967
967
    def test_describe_plugins(self):
 
968
        class DummyModule(object):
 
969
            __doc__ = 'Hi there'
 
970
        class DummyPlugin(object):
 
971
            __version__ = '0.1.0'
 
972
            module = DummyModule()
 
973
        def dummy_plugins():
 
974
            return { 'good': DummyPlugin() }
968
975
        self.overrideAttr(plugin, 'plugin_warnings',
969
976
            {'bad': ['Failed to load (just testing)']})
 
977
        self.overrideAttr(plugin, 'plugins', dummy_plugins)
970
978
        self.assertEquals("""\
971
979
bad (failed to load)
972
980
  ** Failed to load (just testing)
973
981
 
 
982
good 0.1.0
 
983
  Hi there
 
984
 
974
985
""", ''.join(plugin.describe_plugins()))