def test_abspath_to_uri_linux2(self): self.assertMatch('/foo/bar.html', 'file:///foo/bar.html', platform='darwin') self.assertEqual( path.abspath_to_uri("/foo/bar.html", platform='linux2'), "file:///foo/bar.html") self.assertEqual( path.abspath_to_uri("/foo/bar.html", platform='linux3'), "file:///foo/bar.html")
def test_abspath_to_uri_linux2(self): self.assertMatch('/foo/bar.html', 'file:///foo/bar.html', platform='darwin') self.assertEqual(path.abspath_to_uri("/foo/bar.html", platform='linux2'), "file:///foo/bar.html") self.assertEqual(path.abspath_to_uri("/foo/bar.html", platform='linux3'), "file:///foo/bar.html")
def test_abspath_to_uri_win(self): self.assertMatch('c:\\foo\\bar.html', 'file:///c:/foo/bar.html', platform='win32') self.assertEqual(path.abspath_to_uri("c:\\foo\\bar.html", platform='win32'), "file:///c:/foo/bar.html")
def test_abspath_to_uri_win(self): self.assertMatch('c:\\foo\\bar.html', 'file:///c:/foo/bar.html', platform='win32') self.assertEqual( path.abspath_to_uri("c:\\foo\\bar.html", platform='win32'), "file:///c:/foo/bar.html")
def test_abspath_to_uri_cygwin(self): if sys.platform != 'cygwin': return self.assertMatch('/cygdrive/c/foo/bar.html', 'file:///C:/foo/bar.html', platform='cygwin') self.assertEqual(path.abspath_to_uri('/cygdrive/c/foo/bar.html', platform='cygwin'), 'file:///C:/foo/bar.html')
def test_abspath_to_uri_cygwin(self): if sys.platform != 'cygwin': return self.assertMatch('/cygdrive/c/foo/bar.html', 'file:///C:/foo/bar.html', platform='cygwin') self.assertEqual( path.abspath_to_uri('/cygdrive/c/foo/bar.html', platform='cygwin'), 'file:///C:/foo/bar.html')
def assertMatch(self, test_path, expected_uri, platform=None): if platform == 'cygwin' and sys.platform != 'cygwin': return self.assertEqual(path.abspath_to_uri(test_path, platform=platform), expected_uri)