def testNonAsciiQuery(self): path = make_url(HOME, q='g \xc3\xb4\xc3\xb6\xc3\xb2') location = make_url( 'https://www.google.com/search', q='\xc3\xb4\xc3\xb6\xc3\xb2', ) self.get(path, redirect=location)
def testSignedInUser(self): commands = [ get_dummy_command(name='a', url_pattern='https://{1}{2}.com'), ] self.tc.signInUser(make_dummy_user(commands=commands)) path = make_url(HOME, q='a b c') self.get(path, redirect='https://bc.com') path = make_url(HOME, q='another query') self.get( path, template='command_error.html', contains='Unknown command', )
def testMissingArguments(self): path = make_url(HOME, q='cron *') self.get( path, template='command_error.html', contains='Not enough arguments', )
def testBadDefaultQuery(self): path = make_url(HOME, q='hello world', default='bye') self.get( path, template='command_error.html', contains='Unknown default command', )
def testGoodQueryWithBadDefault(self): path = make_url(HOME, q='g hello', default='bye') location = make_url('https://www.google.com/search', q='hello') self.get(path, redirect=location)
def testMalformedQuery(self): path = make_url(HOME, q='') self.get(path, redirect='http://localhost' + HOME)
def testGoodDefaultQuery(self): path = make_url(HOME, q='hello world', default='g') location = make_url('https://www.google.com/search', q='hello world') self.get(path, redirect=location)