Gogs est une interface web basée sur git et une bonne alternative à GitHub.
# -*- coding: utf-8 -*- from collections import defaultdict import mock from searx.engines import framalibre from searx.testing import SearxTestCase class TestFramalibreEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(dict) dicto['pageno'] = 0 params = framalibre.request(query, dicto) self.assertTrue('url' in params) self.assertTrue(query in params['url']) self.assertTrue('framalibre.org' in params['url']) def test_response(self): self.assertRaises(AttributeError, framalibre.response, None) self.assertRaises(AttributeError, framalibre.response, []) self.assertRaises(AttributeError, framalibre.response, '') self.assertRaises(AttributeError, framalibre.response, '[]') response = mock.Mock(text='{}') self.assertEqual(framalibre.response(response), []) response = mock.Mock(text='{"data": []}') self.assertEqual(framalibre.response(response), []) html = u"""