[mod] searx.search.EngineRef: remove from_bang parameter

from_bang is True when the user query contains a bang.
In this case the category is also set to 'none'.

from_bang only usage was in searx.webadapter.parse_specific :
if from_bang is True, then the EngineRef category is ignored and force to 'none'.

This commit also removes the searx.webadapter.parse_sepecific function.
This commit is contained in:
Alexandre Flament 2020-12-18 12:19:14 +01:00
parent 995ba2f406
commit eda8934f15
5 changed files with 12 additions and 24 deletions

View file

@ -23,13 +23,13 @@ TEST_ENGINES = [
class SearchQueryTestCase(SearxTestCase):
def test_repr(self):
s = SearchQuery('test', [EngineRef('bing', 'general', False)], 'all', 0, 1, '1', 5.0, 'g')
s = SearchQuery('test', [EngineRef('bing', 'general')], 'all', 0, 1, '1', 5.0, 'g')
self.assertEqual(repr(s),
"SearchQuery('test', [EngineRef('bing', 'general', False)], 'all', 0, 1, '1', 5.0, 'g')") # noqa
"SearchQuery('test', [EngineRef('bing', 'general')], 'all', 0, 1, '1', 5.0, 'g')") # noqa
def test_eq(self):
s = SearchQuery('test', [EngineRef('bing', 'general', False)], 'all', 0, 1, None, None, None)
t = SearchQuery('test', [EngineRef('google', 'general', False)], 'all', 0, 1, None, None, None)
s = SearchQuery('test', [EngineRef('bing', 'general')], 'all', 0, 1, None, None, None)
t = SearchQuery('test', [EngineRef('google', 'general')], 'all', 0, 1, None, None, None)
self.assertEqual(s, s)
self.assertNotEqual(s, t)