Esempio n. 1
0
 def test_request(self):
     query = 'test_query'
     dicto = defaultdict(dict)
     dicto['pageno'] = 1
     params = wolframalpha_noapi.request(query, dicto)
     self.assertIn('url', params)
     self.assertIn(query, params['url'])
     self.assertIn('wolframalpha.com', params['url'])
 def test_request(self):
     query = 'test_query'
     dicto = defaultdict(dict)
     dicto['pageno'] = 1
     params = wolframalpha_noapi.request(query, dicto)
     self.assertIn('url', params)
     self.assertIn(query, params['url'])
     self.assertIn('wolframalpha.com', params['url'])
Esempio n. 3
0
    def test_request(self):
        query = 'test_query'
        dicto = defaultdict(dict)
        params = wolframalpha_noapi.request(query, dicto)

        self.assertIn('url', params)
        self.assertIn('https://www.wolframalpha.com/input/json.jsp', params['url'])
        self.assertIn(query, params['url'])
        self.assertEqual('https://www.wolframalpha.com/input/?i=test_query', params['headers']['Referer'])
    def test_request(self):
        query = 'test_query'
        dicto = defaultdict(dict)
        params = wolframalpha_noapi.request(query, dicto)

        self.assertIn('url', params)
        self.assertIn('https://www.wolframalpha.com/input/json.jsp',
                      params['url'])
        self.assertIn(query, params['url'])
        self.assertEqual('https://www.wolframalpha.com/input/?i=test_query',
                         params['headers']['Referer'])