示例#1
0
    def test_request(self):
        query = 'test_query'
        dic = defaultdict(dict)
        dic['pageno'] = 1
        dic['language'] = 'en_US'
        params = archlinux.request(query, dic)
        self.assertTrue('url' in params)
        self.assertTrue(query in params['url'])
        self.assertTrue('wiki.archlinux.org' in params['url'])

        for lang, domain in domains.iteritems():
            dic['language'] = lang
            params = archlinux.request(query, dic)
            self.assertTrue(domain in params['url'])
示例#2
0
    def test_request(self):
        query = 'test_query'
        dic = defaultdict(dict)
        dic['pageno'] = 1
        dic['language'] = 'en_US'
        params = archlinux.request(query, dic)
        self.assertTrue('url' in params)
        self.assertTrue(query in params['url'])
        self.assertTrue('wiki.archlinux.org' in params['url'])

        for lang, domain in domains.items():
            dic['language'] = lang
            params = archlinux.request(query, dic)
            self.assertTrue(domain in params['url'])