App Example 1
Description App Example 1
GPL-3.0-only
import mock from collections import defaultdict from searx.engines import fdroid from searx.testing import SearxTestCase class TestFdroidEngine(SearxTestCase): def test_request(self): query = 'test_query' dic = defaultdict(dict) dic['pageno'] = 1 params = fdroid.request(query, dic) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('search.f-droid.org' in params['url']) def test_response_empty(self): resp = mock.Mock(text='') self.assertEqual(fdroid.response(resp), []) def test_response_oneresult(self): html = """