Beispiel #1
0
 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")
Beispiel #2
0
 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")
Beispiel #3
0
 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")
Beispiel #4
0
 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")
Beispiel #5
0
    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')
Beispiel #6
0
    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')
Beispiel #7
0
 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)
Beispiel #8
0
 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)