當前位置: 首頁>>代碼示例>>Python>>正文


Python util.FilePath類代碼示例

本文整理匯總了Python中vdebug.util.FilePath的典型用法代碼示例。如果您正苦於以下問題:Python FilePath類的具體用法?Python FilePath怎麽用?Python FilePath使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FilePath類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_as_local_with_uri

    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())
開發者ID:Alkagar,項目名稱:configs,代碼行數:8,代碼來源:test_util_filepath.py

示例2: test_as_remote_with_win_paths

    def test_as_remote_with_win_paths(self):
        filename = "C:/local1/path/to/file"
        file = FilePath(filename)
        self.assertEqual("file:///C:/remote1/path/to/file",file.as_remote())

        filename = "file:///C:/local2/path/to/file"
        file = FilePath(filename)
        self.assertEqual("file:///C:/remote2/path/to/file",file.as_remote())
開發者ID:Alkagar,項目名稱:configs,代碼行數:8,代碼來源:test_util_filepath.py

示例3: test_as_remote

    def test_as_remote(self):
        filename = "G:\\local\\path\\to\\file"
        file = FilePath(filename)
        self.assertEqual("file:///remote/path/to/file",file.as_remote())

        filename = "file:///G:/local2/path/to/file"
        file = FilePath(filename)
        self.assertEqual("file:///remote2/path/to/file",file.as_remote())
開發者ID:Taluu,項目名稱:vdebug,代碼行數:8,代碼來源:test_util_filepath.py

示例4: test_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())
開發者ID:Taluu,項目名稱:vdebug,代碼行數:8,代碼來源:test_util_filepath.py

示例5: test_as_remote_with_backslashed_win_paths

    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())
開發者ID:Alkagar,項目名稱:configs,代碼行數:12,代碼來源:test_util_filepath.py

示例6: test_as_remote

 def test_as_remote(self):
     filename = "/home/user/some/path"
     file = FilePath(filename)
     self.assertEqual(filename,file.as_remote())
開發者ID:t4ku,項目名稱:vdebug,代碼行數:4,代碼來源:test_util_filepath.py

示例7: test_remote_prefix

 def test_remote_prefix(self):
     prefix = "file://"
     filename = "/home/user/some/path"
     file = FilePath(prefix+filename)
     self.assertEqual(filename,file.as_local())
開發者ID:t4ku,項目名稱:vdebug,代碼行數:5,代碼來源:test_util_filepath.py

示例8: test_win

 def test_win(self):
     quoted = "file:///C:/home/user/file%2etcl"
     file = FilePath(quoted)
     self.assertEqual("C:\\home\\user\\file.tcl",file.as_local())
開發者ID:Alkagar,項目名稱:configs,代碼行數:4,代碼來源:test_util_filepath.py

示例9: test_quoted

 def test_quoted(self):
     quoted = "file:///home/user/file%2etcl"
     file = FilePath(quoted)
     self.assertEqual("/home/user/file.tcl",file.as_local())
開發者ID:Alkagar,項目名稱:configs,代碼行數:4,代碼來源:test_util_filepath.py

示例10: test_as_local_does_nothing

 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())
開發者ID:Alkagar,項目名稱:configs,代碼行數:4,代碼來源:test_util_filepath.py


注:本文中的vdebug.util.FilePath類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。