def testSplitUnsupported(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('ftp://jarn.com/public'), ('ftp', '', 'jarn.com', '/public', '', ''))
def testSplitLocalhostWithTilde(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('file://localhost/~stefan/public'), ('file', '', 'localhost', '/~stefan/public', '', ''))
def testSplitHttp(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('http://jarn.com/public'), ('http', '', 'jarn.com', '/public', '', ''))
def testSplitFile(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('file:///var/dist/public'), ('file', '', '', '/var/dist/public', '', ''))
def testSplitSvn(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('svn://jarn.com/public'), ('svn', '', 'jarn.com', '/public', '', ''))
def testSplitRsync(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('rsync://jarn.com/public'), ('rsync', '', 'jarn.com', '/public', '', ''))
def testSplitSsh(self): urlparser = URLParser() self.assertEqual( urlparser.urlsplit('ssh://[email protected]//hg/public'), ('ssh', 'stefan', 'jarn.com', '//hg/public', '', ''))
def testSplitGit(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('git://jarn.com/public'), ('git', '', 'jarn.com', '/public', '', ''))
def testSplitSftp(self): urlparser = URLParser() self.assertEqual( urlparser.urlsplit('sftp://[email protected]/var/dist/public'), ('sftp', 'stefan', 'jarn.com', '/var/dist/public', '', ''))
def testSplitBadUrl(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('ssh:[email protected]/public'), ('', '', '', 'ssh:[email protected]/public', '', ''))
def testSplitSftp(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('sftp://[email protected]/var/dist/public'), ('sftp', 'stefan', 'jarn.com', '/var/dist/public', '', ''))
def testSplitHttps(self): urlparser = URLParser() self.assertEqual( urlparser.urlsplit('https://*****:*****@jarn.com/public'), ('https', 'stefan:secret', 'jarn.com', '/public', '', ''))
def testSplitSsh(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('ssh://[email protected]//hg/public'), ('ssh', 'stefan', 'jarn.com', '//hg/public', '', ''))
def testSplitRelativeFile(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('file:var/dist/public'), ('file', '', '', 'var/dist/public', '', ''))
def testSplitHttps(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('https://*****:*****@jarn.com/public'), ('https', 'stefan:secret', 'jarn.com', '/public', '', ''))
def testSplitRelativeFileWithTilde(self): urlparser = URLParser() self.assertEqual(urlparser.urlsplit('file:~stefan/public'), ('file', '', '', '~stefan/public', '', ''))