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