/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_urlutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-06-14 17:58:24 UTC
  • mfrom: (5254.1.5 urlutils-lp-support)
  • Revision ID: pqm@pqm.ubuntu.com-20100614175824-nq51rf1uetnut04t
Improved ``bzrlib.urlutils`` to handle lp:foo/bar URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
        # Weird stuff
157
157
        # Can't have slashes or colons in the scheme
158
158
        test_one('/path/to/://foo', None)
159
 
        test_one('path:path://foo', None)
 
159
        test_one('scheme:stuff://foo', ('scheme', 'stuff://foo'))
160
160
        # Must have more than one character for scheme
161
161
        test_one('C://foo', None)
162
162
        test_one('ab://foo', ('ab', 'foo'))
210
210
        test('http://foo/bar/baz', 'http://foo', 'bar/baz')
211
211
        test('http://foo/baz', 'http://foo', 'bar/../baz')
212
212
        test('http://foo/baz', 'http://foo/bar/', '../baz')
 
213
        test('lp:foo/bar', 'lp:foo', 'bar')
 
214
        test('lp:foo/bar/baz', 'lp:foo', 'bar/baz')
213
215
 
214
216
        # Absolute paths
215
217
        test('http://foo', 'http://foo') # abs url with nothing is preserved.
219
221
        test('http://bar/', 'http://foo', 'http://bar/')
220
222
        test('http://bar/a', 'http://foo', 'http://bar/a')
221
223
        test('http://bar/a/', 'http://foo', 'http://bar/a/')
 
224
        test('lp:bar', 'http://foo', 'lp:bar')
 
225
        test('lp:bar', 'lp:foo', 'lp:bar')
 
226
        test('file:///stuff', 'lp:foo', 'file:///stuff')
222
227
 
223
228
        # From a base path
224
229
        test('file:///foo', 'file:///', 'foo')