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


Python URLParser.to_ssh_url方法代碼示例

本文整理匯總了Python中jarn.mkrelease.urlparser.URLParser.to_ssh_url方法的典型用法代碼示例。如果您正苦於以下問題:Python URLParser.to_ssh_url方法的具體用法?Python URLParser.to_ssh_url怎麽用?Python URLParser.to_ssh_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jarn.mkrelease.urlparser.URLParser的用法示例。


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

示例1: testEmptyString

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testEmptyString(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url(''), ('', ''))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:5,代碼來源:test_urlparser.py

示例2: testUserOnly

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testUserOnly(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('scp://[email protected]/var/dist/public'),
                      ('scp', '[email protected]:/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例3: testWhitespace

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testWhitespace(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url(' ssh://[email protected]/var/dist/public'),
                      ('', ' ssh://[email protected]/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例4: testNoPath

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testNoPath(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('scp://[email protected]'),
                      ('scp', '[email protected]:'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例5: testNoUser

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testNoUser(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('scp://jarn.com/var/dist/public'),
                      ('scp', 'jarn.com:/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例6: testNoHost

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testNoHost(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('scp:///var/dist/public'),
                      ('scp', ':/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例7: testNoUrl

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testNoUrl(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('scp://'),
                      ('scp', ':'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例8: testBadUrl

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testBadUrl(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('https://[email protected]/var/dist/public'),
                      ('https', 'https://[email protected]/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py

示例9: testIdempotence

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testIdempotence(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('[email protected]:var/dist/public'),
                      ('', '[email protected]:var/dist/public'))
     self.assertEqual(urlparser.to_ssh_url('[email protected]:/var/dist/public'),
                      ('', '[email protected]:/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:8,代碼來源:test_urlparser.py

示例10: testSftp

# 需要導入模塊: from jarn.mkrelease.urlparser import URLParser [as 別名]
# 或者: from jarn.mkrelease.urlparser.URLParser import to_ssh_url [as 別名]
 def testSftp(self):
     urlparser = URLParser()
     self.assertEqual(urlparser.to_ssh_url('sftp://[email protected]/var/dist/public'),
                      ('sftp', '[email protected]:/var/dist/public'))
開發者ID:Jarn,項目名稱:jarn.mkrelease,代碼行數:6,代碼來源:test_urlparser.py


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