/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: James Westby
  • Date: 2008-03-17 13:10:32 UTC
  • mto: This revision was merged to the branch mainline in revision 3296.
  • Revision ID: jw+debian@jameswestby.net-20080317131032-8meoti7nsremfjn3
Strip "bzr_" from the start of the suggested plugin name.

When bzr tries to load a plugin from a path that isn't a valid python
module name it will suggest the user renames it to one that is.

A bzr- prefix is often not wanted, and may be a common error, so 
suggest stripping it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
    def test_plugin_with_bad_name_does_not_load(self):
193
193
        # Create badly-named plugin
194
 
        file('bad plugin-name..py', 'w').close()
 
194
        file('bzr-bad plugin-name..py', 'w').close()
195
195
 
196
196
        # Capture output
197
197
        stream = StringIO()
207
207
        log.removeHandler(handler)
208
208
 
209
209
        self.assertContainsRe(stream.getvalue(),
210
 
            r"Unable to load 'bad plugin-name\.' in '\.' as a plugin because"
211
 
            " file path isn't a valid module name; try renaming it to"
212
 
            " 'bad_plugin_name_'\.")
 
210
            r"Unable to load 'bzr-bad plugin-name\.' in '\.' as a plugin "
 
211
            "because the file path isn't a valid module name; try renaming "
 
212
            "it to 'bad_plugin_name_'\.")
213
213
 
214
214
        stream.close()
215
215