def test_request(self): query = u'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr_FR' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('language%3AFR' in params['url']) self.assertTrue('bing.com' in params['url']) dicto['language'] = 'all' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('language' in params['url'])
def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr_FR' params = bing.request(query, dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('language%3AFR' in params['url']) self.assertTrue('bing.com' in params['url']) dicto['language'] = 'all' params = bing.request(query, dicto) self.assertTrue('language' not in params['url'])
def test_request(self): bing.supported_languages = ['en', 'fr', 'zh-CHS', 'zh-CHT', 'pt-PT', 'pt-BR'] query = u'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr-FR' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('language%3AFR' in params['url']) self.assertTrue('bing.com' in params['url']) dicto['language'] = 'all' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('language' in params['url'])
def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr_FR' params = bing.request(query, dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('bing.com' in params['url']) self.assertTrue('SRCHHPGUSR' in params['cookies']) self.assertTrue('fr' in params['cookies']['SRCHHPGUSR']) dicto['language'] = 'all' params = bing.request(query, dicto) self.assertTrue('SRCHHPGUSR' in params['cookies']) self.assertTrue('en' in params['cookies']['SRCHHPGUSR'])
def test_request(self): query = "test_query" dicto = defaultdict(dict) dicto["pageno"] = 0 dicto["language"] = "fr_FR" params = bing.request(query, dicto) self.assertTrue("url" in params) self.assertTrue(query in params["url"]) self.assertTrue("bing.com" in params["url"]) self.assertTrue("SRCHHPGUSR" in params["cookies"]) self.assertTrue("fr" in params["cookies"]["SRCHHPGUSR"]) dicto["language"] = "all" params = bing.request(query, dicto) self.assertTrue("SRCHHPGUSR" in params["cookies"]) self.assertTrue("en" in params["cookies"]["SRCHHPGUSR"])
def test_request(self): bing.supported_languages = [ 'en', 'fr', 'zh-CHS', 'zh-CHT', 'pt-PT', 'pt-BR' ] query = u'test_query' dicto = defaultdict(dict) dicto['pageno'] = 1 dicto['language'] = 'fr-FR' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('language%3AFR' in params['url']) self.assertTrue('bing.com' in params['url']) dicto['language'] = 'all' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('language' in params['url'])
def test_request(self): query = u'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr-FR' params = bing.request(query.encode('utf-8'), dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('language%3AFR' in params['url']) self.assertTrue('bing.com' in params['url'])