def testSsh(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('ssh://'), False)
def testBadUrl(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('ssh'), False)
def testUserOnly(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('stefan@:/var/dist/public'), True)
def testSlashBeforeColon(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('/foo:'), False)
def testNonAlphanumeric(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('$&%:'), True)
def testColonOnly(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url(':'), False)
def testUnknown(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('foo://'), False)
def testFalsePositives(self): # Everything with a colon matches the regex... urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('foo:'), True)
def testUnsupported(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('ftp://'), False)
def testGit(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('git://'), False)
def testNonConsecutive(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('f o:'), False)
def testWhitespace(self): urlparser = URLParser() self.assertEqual( urlparser.is_ssh_url(' [email protected]:Jarn/jarn.mkrelease'), False)
def testEmptyString(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url(''), False)
def testWhitespace(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url(' [email protected]:Jarn/jarn.mkrelease'), False)
def testGitSsh(self): urlparser = URLParser() self.assertEqual(urlparser.is_ssh_url('[email protected]:Jarn/jarn.mkrelease'), True)
def testGitSsh(self): urlparser = URLParser() self.assertEqual( urlparser.is_ssh_url('[email protected]:Jarn/jarn.mkrelease'), True)