本文整理汇总了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'))