def test_request(self):
        query = 'test_query'
        dicto = defaultdict(dict)
        dicto['pageno'] = 1
        dicto['language'] = 'fr_FR'
        dicto['time_range'] = 'w'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertIn(query, params['url'])
        self.assertIn('fr', params['url'])

        dicto['language'] = 'all'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertNotIn('fr', params['url'])
Пример #2
0
    def test_request(self):
        query = 'test_query'
        dicto = defaultdict(dict)
        dicto['pageno'] = 1
        dicto['language'] = 'fr_FR'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertIn(query, params['url'])
        self.assertIn('googleapis.com', params['url'])
        self.assertIn('fr', params['url'])

        dicto['language'] = 'all'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertIn('en', params['url'])
Пример #3
0
    def test_request(self):
        google_news.supported_languages = ['en-US', 'fr-FR']
        google_news.language_aliases = {}
        query = 'test_query'
        dicto = defaultdict(dict)
        dicto['pageno'] = 1
        dicto['language'] = 'fr-FR'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertIn(query, params['url'])
        self.assertIn('fr', params['url'])

        dicto['language'] = 'all'
        params = google_news.request(query, dicto)
        self.assertIn('url', params)
        self.assertNotIn('fr', params['url'])
Пример #4
0
 def test_request(self):
     query = 'test_query'
     dicto = defaultdict(dict)
     dicto['pageno'] = 1
     dicto['language'] = 'fr-FR'
     dicto['time_range'] = 'w'
     params = google_news.request(query, dicto)
     self.assertIn('url', params)
     self.assertIn(query, params['url'])
     self.assertIn('fr', params['url'])
Пример #5
0
 def test_request(self):
     google_news.supported_languages = ['en-US', 'fr-FR']
     query = 'test_query'
     dicto = defaultdict(dict)
     dicto['pageno'] = 1
     dicto['language'] = 'fr-FR'
     dicto['time_range'] = 'w'
     params = google_news.request(query, dicto)
     self.assertIn('url', params)
     self.assertIn(query, params['url'])
     self.assertIn('fr', params['url'])