~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-11 18:49:54 UTC
  • mfrom: (6060.1.4 2.5-win32-fixes)
  • Revision ID: pqm@pqm.ubuntu.com-20110811184954-7z846r214w274v8h
(vila) Small test suite fixes for Windows. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1058
1058
 
1059
1059
class TestLocationToUrl(tests.TestCase):
1060
1060
 
 
1061
    def get_base_location(self):
 
1062
        path = osutils.abspath('/foo/bar')
 
1063
        if path.startswith('/'):
 
1064
            url = 'file://%s' % (path,)
 
1065
        else:
 
1066
            # On Windows, abspaths start with the drive letter, so we have to
 
1067
            # add in the extra '/'
 
1068
            url = 'file:///%s' % (path,)
 
1069
        return path, url
 
1070
 
1061
1071
    def test_regular_url(self):
1062
1072
        self.assertEquals("file://foo", location_to_url("file://foo"))
1063
1073
 
1071
1081
            "http://fo/\xc3\xaf".decode("utf-8"))
1072
1082
 
1073
1083
    def test_unicode_path(self):
1074
 
        self.assertEquals("file:///foo/bar%C3%AF",
1075
 
            location_to_url("/foo/bar\xc3\xaf".decode("utf-8")))
 
1084
        path, url = self.get_base_location()
 
1085
        location = path + "\xc3\xaf".decode("utf-8")
 
1086
        url += '%C3%AF'
 
1087
        self.assertEquals(url, location_to_url(location))
1076
1088
 
1077
1089
    def test_path(self):
1078
 
        self.assertEquals("file:///foo/bar", location_to_url("/foo/bar"))
 
1090
        path, url = self.get_base_location()
 
1091
        self.assertEquals(url, location_to_url(path))
1079
1092
 
1080
1093
    def test_relative_file_url(self):
1081
1094
        self.assertEquals(urlutils.local_path_to_url(".") + "/bar",