diff options
author | Martin Fischer <martin@push-f.com> | 2022-01-06 13:45:25 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-01-06 14:10:58 +0100 |
commit | 61935c72efa3c164184cecccc7cdc5713a93d654 (patch) | |
tree | 29cb887129d4b496891b0a28dec61f6b7d592712 /tests | |
parent | 03189d60f474e2aeb758760ecae8140771c8c75d (diff) | |
download | searxng-61935c72efa3c164184cecccc7cdc5713a93d654.tar.gz searxng-61935c72efa3c164184cecccc7cdc5713a93d654.zip |
[fix] remove broken ? search operator
The ? search operator has been broken for some time and
currently only raises the question why it's still there.
## Context ##
The query "Paris !images" searches for "Paris" in the "images" category.
Once upon a time Searx supported "Paris ?images" to search for "Paris"
in the currently enabled categories and the "images" category.
The feature makes sense ... the ? syntax does not.
We will hopefully introduce a +!images syntax in the future.
Fixes #702.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_query.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/unit/test_query.py b/tests/unit/test_query.py index 9a53f8f47..05fcafe30 100644 --- a/tests/unit/test_query.py +++ b/tests/unit/test_query.py @@ -230,13 +230,12 @@ class TestExternalBangParser(SearxTestCase): class TestBang(SearxTestCase): SPECIFIC_BANGS = ['!dummy_engine', '!du', '!general'] - NOT_SPECIFIC_BANGS = ['?dummy_engine', '?du', '?general'] THE_QUERY = 'the query' def test_bang(self): load_engines(TEST_ENGINES) - for bang in TestBang.SPECIFIC_BANGS + TestBang.NOT_SPECIFIC_BANGS: + for bang in TestBang.SPECIFIC_BANGS: with self.subTest(msg="Check bang", bang=bang): query_text = TestBang.THE_QUERY + ' ' + bang query = RawTextQuery(query_text, []) @@ -252,13 +251,6 @@ class TestBang(SearxTestCase): query = RawTextQuery(query_text, []) self.assertTrue(query.specific) - def test_not_specific(self): - for bang in TestBang.NOT_SPECIFIC_BANGS: - with self.subTest(msg="Check bang is not specific", bang=bang): - query_text = TestBang.THE_QUERY + ' ' + bang - query = RawTextQuery(query_text, []) - self.assertFalse(query.specific) - def test_bang_not_found(self): load_engines(TEST_ENGINES) query = RawTextQuery('the query !bang_not_found', []) @@ -278,5 +270,5 @@ class TestBang(SearxTestCase): query = RawTextQuery('the query !', []) self.assertEqual(query.autocomplete_list, ['!images', '!wikipedia', '!osm']) - query = RawTextQuery('the query ?', ['osm']) - self.assertEqual(query.autocomplete_list, ['?images', '?wikipedia']) + query = RawTextQuery('the query !', ['osm']) + self.assertEqual(query.autocomplete_list, ['!images', '!wikipedia']) |