本文整理汇总了Python中jarn.mkrelease.urlparser.URLParser类的典型用法代码示例。如果您正苦于以下问题:Python URLParser类的具体用法?Python URLParser怎么用?Python URLParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了URLParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSplitRelativeFileWithTilde
def testSplitRelativeFileWithTilde(self):
urlparser = URLParser()
self.assertEqual(urlparser.split('file:~stefan/public'),
('file', '', '', '~stefan/public', '', ''))
示例2: testFileUrl
def testFileUrl(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('file://'), True)
示例3: testBadScheme
def testBadScheme(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('ftp//'), False)
示例4: testLocalhostExpandUser
def testLocalhostExpandUser(self):
urlparser = URLParser()
logname = os.environ.get('LOGNAME')
home = os.environ.get('HOME')
self.assertEqual(urlparser.abspath('file://localhost/~%s/public' % logname),
'file://localhost%s/public' % home)
示例5: testSshUrl
def testSshUrl(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('ssh://'), True)
示例6: testWhitespace
def testWhitespace(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url(' http://'), False)
示例7: testRelativeFile
def testRelativeFile(self):
urlparser = URLParser()
cwd = os.getcwd()
self.assertEqual(urlparser.abspath('file:var/dist/public'),
'file://%s/var/dist/public' % cwd)
示例8: testGit
def testGit(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('git://jarn.com/public'), True)
示例9: testRsync
def testRsync(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('rsync://jarn.com/public'), True)
示例10: testSplitBadUrl
def testSplitBadUrl(self):
urlparser = URLParser()
self.assertEqual(urlparser.split('ssh:[email protected]/public'),
('', '', '', 'ssh:[email protected]/public', '', ''))
示例11: testSvn
def testSvn(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('svn://jarn.com/public'), True)
示例12: testSplitUnsupported
def testSplitUnsupported(self):
urlparser = URLParser()
self.assertEqual(urlparser.split('ftp://jarn.com/public'),
('ftp', '', 'jarn.com', '/public', '', ''))
示例13: testSplitGitWithTilde
def testSplitGitWithTilde(self):
urlparser = URLParser()
self.assertEqual(urlparser.split('git://jarn.com/~stefan/public'),
('git', '', 'jarn.com', '/~stefan/public', '', ''))
示例14: testSplitLocalhostWithTilde
def testSplitLocalhostWithTilde(self):
urlparser = URLParser()
self.assertEqual(urlparser.split('file://localhost/~stefan/public'),
('file', '', 'localhost', '/~stefan/public', '', ''))
示例15: testUnsupported
def testUnsupported(self):
urlparser = URLParser()
self.assertEqual(urlparser.is_url('ftp://jarn.com/public'), True)