Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
    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',
        )
Exemplo n.º 3
0
 def testMissingArguments(self):
     path = make_url(HOME, q='cron *')
     self.get(
         path,
         template='command_error.html',
         contains='Not enough arguments',
     )
Exemplo n.º 4
0
 def testBadDefaultQuery(self):
     path = make_url(HOME, q='hello world', default='bye')
     self.get(
         path,
         template='command_error.html',
         contains='Unknown default command',
     )
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 def testMalformedQuery(self):
     path = make_url(HOME, q='')
     self.get(path, redirect='http://localhost' + HOME)
Exemplo n.º 7
0
 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)