本文整理匯總了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(''), ('', ''))
示例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'))
示例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'))
示例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]:'))
示例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'))
示例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'))
示例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', ':'))
示例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'))
示例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'))
示例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'))