def test_garbageMatch(self): r = 'http://example.com/return.to' self.failUnless( trustroot.returnToMatches([ 'This is not a URL at all. In fact, it has characters, ' 'like "<" that are not allowed in URLs', r ], r))
def test_garbageMatch(self): r = 'http://example.com/return.to' self.failUnless(trustroot.returnToMatches( ['This is not a URL at all. In fact, it has characters, ' 'like "<" that are not allowed in URLs', r], r))
def test_descendant(self): r = 'http://example.com/return.to' self.failUnless(trustroot.returnToMatches( [r], 'http://example.com/return.to/user:joe'))
def test_exactMatch(self): r = 'http://example.com/return.to' self.failUnless(trustroot.returnToMatches([r], r))
def test_noEntries(self): self.failIf(trustroot.returnToMatches([], 'anything'))
def test_exactMatch(self): r = 'http://example.com/return.to' self.assertTrue(trustroot.returnToMatches([r], r))
def test_noEntries(self): self.assertFalse(trustroot.returnToMatches([], 'anything'))
def test_wildcard(self): self.assertFalse( trustroot.returnToMatches(['http://*.example.com/return.to'], 'http://example.com/return.to'))
def test_descendant(self): r = 'http://example.com/return.to' self.assertTrue( trustroot.returnToMatches([r], 'http://example.com/return.to/user:joe'))
def test_garbageMatch(self): r = 'http://example.com/return.to' realm = 'This is not a URL at all. In fact, it has characters, like "<" that are not allowed in URLs' self.assertTrue(trustroot.returnToMatches([realm, r], r))
def test_wildcard(self): self.failIf(trustroot.returnToMatches( ['http://*.example.com/return.to'], 'http://example.com/return.to'))
def test_noMatch(self): r = 'http://example.com/return.to' self.assertFalse( trustroot.returnToMatches([r], 'http://example.com/xss_exploit'))
def test_noMatch(self): r = 'http://example.com/return.to' self.failIf(trustroot.returnToMatches( [r], 'http://example.com/xss_exploit'))