本文整理汇总了Python中vdebug.util.FilePath.as_local方法的典型用法代码示例。如果您正苦于以下问题:Python FilePath.as_local方法的具体用法?Python FilePath.as_local怎么用?Python FilePath.as_local使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vdebug.util.FilePath
的用法示例。
在下文中一共展示了FilePath.as_local方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_as_local_with_uri
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
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())
示例2: test_as_local
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
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())
示例3: test_as_remote_with_backslashed_win_paths
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
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())
示例4: test_remote_prefix
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
def test_remote_prefix(self):
prefix = "file://"
filename = "/home/user/some/path"
file = FilePath(prefix+filename)
self.assertEqual(filename,file.as_local())
示例5: test_as_local
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
def test_as_local(self):
filename = "/home/user/some/path"
file = FilePath(filename)
self.assertEqual(filename,file.as_local())
示例6: test_win
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
def test_win(self):
quoted = "file:///C:/home/user/file%2etcl"
file = FilePath(quoted)
self.assertEqual("C:\\home\\user\\file.tcl",file.as_local())
示例7: test_quoted
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
def test_quoted(self):
quoted = "file:///home/user/file%2etcl"
file = FilePath(quoted)
self.assertEqual("/home/user/file.tcl",file.as_local())
示例8: test_as_local_does_nothing
# 需要导入模块: from vdebug.util import FilePath [as 别名]
# 或者: from vdebug.util.FilePath import as_local [as 别名]
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())