本文整理匯總了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)