Example #1
0
 def test_windows(self):
     # c:\toto.txt
     uri = vfs.get_reference('c:stuff/blah')
     self.assertEqual('c:stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('file:///c:/stuff/blah')
     self.assertEqual('c:/stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('c:/stuff/blah#5')
     self.assertEqual('c:/stuff/blah', str(uri.path))
     self.assertEqual('5', uri.fragment)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('c:/stuff/blah#whatever')
     self.assertEqual('c:/stuff/blah#whatever', str(uri.path))
     self.assertEqual(None, uri.fragment)
     self.assertEqual('file', uri.scheme)
Example #2
0
 def test_windows(self):
     # c:\toto.txt
     uri = vfs.get_reference('c:stuff/blah')
     self.assertEqual('c:stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('file:///c:/stuff/blah')
     self.assertEqual('c:/stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('c:/stuff/blah#5')
     self.assertEqual('c:/stuff/blah', str(uri.path))
     self.assertEqual('5', uri.fragment)
     self.assertEqual('file', uri.scheme)
     uri = vfs.get_reference('c:/stuff/blah#whatever')
     self.assertEqual('c:/stuff/blah#whatever', str(uri.path))
     self.assertEqual(None, uri.fragment)
     self.assertEqual('file', uri.scheme)
Example #3
0
 def test_dirname(self):
     base = vfs.get_reference('stuff/blah')
     uri = vfs.get_dirname(base)
     self.assertEqual('stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('./', uri.path)
     base = vfs.get_reference('/stuff/blah/')
     uri = vfs.get_dirname(base)
     self.assertEqual('/stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('/', uri.path)
     base = vfs.get_reference('file:///stuff/blah/')
     uri = vfs.get_dirname(base)
     print "path=%s" % uri.path
     self.assertEqual('/stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('/', uri.path)
Example #4
0
 def test_linux(self):
     # file://home/toto.txt
     uri = vfs.get_reference('stuff/blah')
     #        print "scheme=%s authority=%s path=%s query=%s fragment=%s" % (
     #            uri.scheme,
     #            uri.authority,
     #            uri.path,
     #            uri.query,
     #            uri.fragment)
     self.assertEqual('stuff/blah', uri.path)
     self.assertEqual('', uri.scheme)
Example #5
0
 def test_dirname(self):
     base = vfs.get_reference('stuff/blah')
     uri = vfs.get_dirname(base)
     self.assertEqual('stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('./', uri.path)
     base = vfs.get_reference('/stuff/blah/')
     uri = vfs.get_dirname(base)
     self.assertEqual('/stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('/', uri.path)
     base = vfs.get_reference('file:///stuff/blah/')
     uri = vfs.get_dirname(base)
     print "path=%s" % uri.path
     self.assertEqual('/stuff/', uri.path)
     uri = vfs.get_dirname(uri)
     print "path=%s" % uri.path
     self.assertEqual('/', uri.path)
Example #6
0
    def test_linux(self):
        # file://home/toto.txt
        uri = vfs.get_reference('stuff/blah')
#        print "scheme=%s authority=%s path=%s query=%s fragment=%s" % (
#            uri.scheme,
#            uri.authority,
#            uri.path,
#            uri.query,
#            uri.fragment)
        self.assertEqual('stuff/blah', uri.path)
        self.assertEqual('', uri.scheme)
Example #7
0
 def test_windows_normalize(self):
     uri = vfs.get_reference('C:/stuff/blah')
     self.assertEqual('c:/stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)
Example #8
0
 def test_windows_normalize(self):
     uri = vfs.get_reference('C:/stuff/blah')
     self.assertEqual('c:/stuff/blah', uri.path)
     self.assertEqual('file', uri.scheme)