This is the content étude à€ http://link.in.tweet pic.twitter.com/rbFsfeE0l3
# -*- coding: utf-8 -*- from collections import defaultdict import mock from searx.engines import twitter from searx.testing import SearxTestCase class TestTwitterEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 dicto['language'] = 'fr_FR' params = twitter.request(query, dicto) self.assertIn('url', params) self.assertIn(query, params['url']) self.assertIn('twitter.com', params['url']) self.assertIn('cookies', params) self.assertIn('lang', params['cookies']) self.assertIn('fr', params['cookies']['lang']) def test_response(self): self.assertRaises(AttributeError, twitter.response, None) self.assertRaises(AttributeError, twitter.response, []) self.assertRaises(AttributeError, twitter.response, '') self.assertRaises(AttributeError, twitter.response, '[]') response = mock.Mock(text='') self.assertEqual(twitter.response(response), []) html = """
This is the content étude à€ http://link.in.tweet pic.twitter.com/rbFsfeE0l3
This is the content étude à€ http://link.in.tweet pic.twitter.com/rbFsfeE0l3
This should be the content.