/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: Aaron Bentley
  • Date: 2006-06-15 20:20:48 UTC
  • mfrom: (1776 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1788.
  • Revision ID: abentley@panoramicfeedback.com-20060615202048-fcee4d87e363a002
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
271
271
        # Not a valid _win32 url, no drive letter
272
272
        self.assertRaises(InvalidURL, from_url, 'file:///path/to/foo')
273
273
 
 
274
    def test__win32_extract_drive_letter(self):
 
275
        extract = urlutils._win32_extract_drive_letter
 
276
        self.assertEqual(('file:///C:', '/foo'), extract('file://', '/C:/foo'))
 
277
        self.assertEqual(('file:///d|', '/path'), extract('file://', '/d|/path'))
 
278
        self.assertRaises(InvalidURL, extract, 'file://', '/path')
 
279
 
274
280
    def test_split(self):
275
281
        # Test bzrlib.urlutils.split()
276
282
        split = urlutils.split
306
312
        self.assertEqual(('path/..', 'foo'), split('path/../foo'))
307
313
        self.assertEqual(('../path', 'foo'), split('../path/foo'))
308
314
 
 
315
    def test__win32_strip_local_trailing_slash(self):
 
316
        strip = urlutils._win32_strip_local_trailing_slash
 
317
        self.assertEqual('file://', strip('file://'))
 
318
        self.assertEqual('file:///', strip('file:///'))
 
319
        self.assertEqual('file:///C', strip('file:///C'))
 
320
        self.assertEqual('file:///C:', strip('file:///C:'))
 
321
        self.assertEqual('file:///d|', strip('file:///d|'))
 
322
        self.assertEqual('file:///C:/', strip('file:///C:/'))
 
323
        self.assertEqual('file:///C:/a', strip('file:///C:/a/'))
 
324
 
309
325
    def test_strip_trailing_slash(self):
310
326
        sts = urlutils.strip_trailing_slash
311
327
        if sys.platform == 'win32':