def test_as_local(self): filename = "/remote/path/to/file" file = FilePath(filename) self.assertEqual("G:\\local\\path\\to\\file", file.as_local()) filename = "file:///remote2/path/to/file" file = FilePath(filename) self.assertEqual("G:\\local2\\path\\to\\file", file.as_local())
def test_as_local_with_uri(self): filename = "file:///remote1/path/to/file" file = FilePath(filename) self.assertEqual("/local1/path/to/file",file.as_local()) filename = "file:///remote2/path/to/file" file = FilePath(filename) self.assertEqual("/local2/path/to/file",file.as_local())
def test_as_local(self): filename = "G:\\remote\\path\\to\\file" file = FilePath(filename) self.assertEqual("/local/path/to/file", file.as_local()) filename = "file:///G:/remote2/path/to/file" file = FilePath(filename) self.assertEqual("/local2/path/to/file", file.as_local())
def test_as_local(self): filename = "/remote/path/to/file" file = FilePath(filename) self.assertEqual("G:\\local\\path\\to\\file",file.as_local()) filename = "file:///remote2/path/to/file" file = FilePath(filename) self.assertEqual("G:\\local2\\path\\to\\file",file.as_local())
def test_as_local(self): filename = "G:\\remote\\path\\to\\file" file = FilePath(filename) self.assertEqual("/local/path/to/file",file.as_local()) filename = "file:///G:/remote2/path/to/file" file = FilePath(filename) self.assertEqual("/local2/path/to/file",file.as_local())
def test_as_remote_with_backslashed_win_paths(self): filename = "C:\\local1\\path\\to\\file" file = FilePath(filename) self.assertEqual("file:///C:/remote1/path/to/file",file.as_remote()) filename = "C:\\local2\\path\\to\\file" file = FilePath(filename) self.assertEqual("file:///C:/remote2/path/to/file",file.as_remote()) filename = "C:/local2/path/to/file" file = FilePath(filename) self.assertEqual("C:\\local2\\path\\to\\file",file.as_local())
def test_remote_prefix(self): prefix = "file://" filename = "/home/user/some/path" file = FilePath(prefix + filename) self.assertEqual(filename, file.as_local())
def test_as_local(self): filename = "/home/user/some/path" file = FilePath(filename) self.assertEqual(filename, file.as_local())
def test_remote_prefix(self): prefix = "file://" filename = "/home/user/some/path" file = FilePath(prefix+filename) self.assertEqual(filename,file.as_local())
def test_as_local(self): filename = "/home/user/some/path" file = FilePath(filename) self.assertEqual(filename,file.as_local())
def test_win(self): quoted = "file:///C:/home/user/file%2etcl" file = FilePath(quoted) self.assertEqual("C:\\home\\user\\file.tcl",file.as_local())
def test_quoted(self): quoted = "file:///home/user/file%2etcl" file = FilePath(quoted) self.assertEqual("/home/user/file.tcl",file.as_local())
def test_as_local_does_nothing(self): filename = "/the/remote/path/to/file" file = FilePath(filename) self.assertEqual("/the/remote/path/to/file",file.as_local())
def test_as_local_does_nothing(self): filename = "G:\\the\\path\\to\\file" file = FilePath(filename) self.assertEqual("G:\\the\\path\\to\\file", file.as_local())
def test_as_local_does_nothing(self): filename = "G:\\the\\path\\to\\file" file = FilePath(filename) self.assertEqual("G:\\the\\path\\to\\file",file.as_local())