~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 18:38:58 UTC
  • mfrom: (1863 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713183858-ebf4aa1f9ef8bb6e
[merge] bzr.dev 1863

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
                           TransportNotPossible,
26
26
                           ConnectionError,
27
27
                           DependencyNotPresent,
28
 
                           InvalidURL,
 
28
                           UnsupportedProtocol,
29
29
                           )
30
30
from bzrlib.tests import TestCase, TestCaseInTempDir
31
31
from bzrlib.transport import (_get_protocol_handlers,
71
71
        try:
72
72
            register_lazy_transport('foo', 'bzrlib.tests.test_transport',
73
73
                    'BadTransportHandler')
74
 
            # TODO: jam 20060427 Now we get InvalidURL because it looks like 
75
 
            #       a URL but we have no support for it.
76
 
            #       Is it better to always fall back to LocalTransport?
77
 
            #       I think this is a better error than a future NoSuchFile
78
 
            self.assertRaises(InvalidURL, get_transport, 'foo://fooserver/foo')
 
74
            try:
 
75
                get_transport('foo://fooserver/foo')
 
76
            except UnsupportedProtocol, e:
 
77
                e_str = str(e)
 
78
                self.assertEquals('Unsupported protocol'
 
79
                                  ' for url "foo://fooserver/foo":'
 
80
                                  ' Unable to import library "some_lib":'
 
81
                                  ' testing missing dependency', str(e))
 
82
            else:
 
83
                self.fail('Did not raise UnsupportedProtocol')
79
84
        finally:
80
85
            # restore original values
81
86
            _set_protocol_handlers(saved_handlers)