def test_absolute_file_url(self): self.assertEquals("file:///bar", location_to_url("file:/bar"))
def test_path(self): path, url = self.get_base_location() self.assertEquals(url, location_to_url(path))
def test_relative_file_url(self): self.assertEquals(urlutils.local_path_to_url(".") + "/bar", location_to_url("file:bar"))
def test_directory(self): directories.register("bar:", SomeDirectory, "Dummy directory") self.addCleanup(directories.remove, "bar:") self.assertEquals("http://bar", location_to_url("bar:"))
def test_unicode_path(self): path, url = self.get_base_location() location = path + "\xc3\xaf".decode("utf-8") url += '%C3%AF' self.assertEquals(url, location_to_url(location))
def test_absolute_file_url(self): self.assertEqual("file:///bar", location_to_url("file:/bar"))
def test_regular_url(self): self.assertEquals("file://foo", location_to_url("file://foo"))
def test_relative_file_url(self): self.assertEqual( urlutils.local_path_to_url(".") + "/bar", location_to_url("file:bar"))
def test_path(self): path, url = self.get_base_location() self.assertEqual(url, location_to_url(path))
def test_unicode_path(self): path, url = self.get_base_location() location = path + "\xc3\xaf".decode("utf-8") url += '%C3%AF' self.assertEqual(url, location_to_url(location))
def test_directory(self): directories.register("bar:", SomeDirectory, "Dummy directory") self.addCleanup(directories.remove, "bar:") self.assertEqual("http://bar", location_to_url("bar:"))
def test_regular_url(self): self.assertEqual("file://foo", location_to_url("file://foo"))