~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

  • Committer: Gordon Tyler
  • Date: 2010-06-02 01:45:31 UTC
  • mto: This revision was merged to the branch mainline in revision 5294.
  • Revision ID: gordon@doxxx.net-20100602014531-q5di42mbztxu7tda
Fixed how get_transport's convert_path_to_url tests whether a path is actually a URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
            dirname('path/to/foo/', exclude_trailing_slash=False))
196
196
        self.assertEqual('path/..', dirname('path/../foo'))
197
197
        self.assertEqual('../path', dirname('../path/foo'))
 
198
    
 
199
    def test_is_url(self):
 
200
        self.assertTrue(urlutils.is_url('http://foo/bar'))
 
201
        self.assertTrue(urlutils.is_url('bzr+ssh://foo/bar'))
 
202
        self.assertTrue(urlutils.is_url('lp:foo/bar'))
 
203
        self.assertTrue(urlutils.is_url('file:///foo/bar'))
 
204
        self.assertFalse(urlutils.is_url(''))
 
205
        self.assertFalse(urlutils.is_url('foo'))
 
206
        self.assertFalse(urlutils.is_url('foo/bar'))
 
207
        self.assertFalse(urlutils.is_url('/foo'))
 
208
        self.assertFalse(urlutils.is_url('/foo/bar'))
 
209
        self.assertFalse(urlutils.is_url('C:/'))
 
210
        self.assertFalse(urlutils.is_url('C:/foo'))
 
211
        self.assertTrue(urlutils.is_url('C:/foo/bar'))
198
212
 
199
213
    def test_join(self):
200
214
        def test(expected, *args):