~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-06-11 07:55:55 UTC
  • mfrom: (5285.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100611075555-qtmp0wp9atss3vkc
(vila) Catch the wrong path descriptions in BZR_PLUGINS_AT

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
import bzrlib
29
29
from bzrlib import (
 
30
    errors,
30
31
    osutils,
31
32
    plugin,
32
33
    plugins,
798
799
        self.assertLength(0, self.warnings)
799
800
 
800
801
 
 
802
class TestLoadPluginAtSyntax(tests.TestCase):
 
803
 
 
804
    def _get_paths(self, paths):
 
805
        return plugin._get_specific_plugin_paths(paths)
 
806
 
 
807
    def test_empty(self):
 
808
        self.assertEquals([], self._get_paths(None))
 
809
        self.assertEquals([], self._get_paths(''))
 
810
 
 
811
    def test_one_path(self):
 
812
        self.assertEquals([('b', 'man')], self._get_paths('b@man'))
 
813
 
 
814
    def test_bogus_path(self):
 
815
        # We need a '@'
 
816
        self.assertRaises(errors.BzrCommandError, self._get_paths, 'batman')
 
817
        # Too much '@' isn't good either
 
818
        self.assertRaises(errors.BzrCommandError, self._get_paths,
 
819
                          'batman@mobile@cave')
 
820
        # An empty description probably indicates a problem
 
821
        self.assertRaises(errors.BzrCommandError, self._get_paths,
 
822
                          os.pathsep.join(['batman@cave', '', 'robin@mobile']))
 
823
 
 
824
 
801
825
class TestLoadPluginAt(tests.TestCaseInTempDir, TestPluginMixin):
802
826
 
803
827
    def setUp(self):