summaryrefslogtreecommitdiff
path: root/tests/unit/test_external_bangs.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-03-11 14:06:26 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-03-11 14:55:38 +0100
commit542f7d0d7bd1a12e1884ba4a1508b40e2514d472 (patch)
tree5256282b267e494200d02914593457854567fec4 /tests/unit/test_external_bangs.py
parent8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (diff)
[mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION
In the past, some files were tested with the standard profile, others with a profile in which most of the messages were switched off ... some files were not checked at all. - ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished - the distinction ``# lint: pylint`` is no longer necessary - the pylint tasks have been reduced from three to two 1. ./searx/engines -> lint engines with additional builtins 2. ./searx ./searxng_extra ./tests -> lint all other python files Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'tests/unit/test_external_bangs.py')
-rw-r--r--tests/unit/test_external_bangs.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/unit/test_external_bangs.py b/tests/unit/test_external_bangs.py
index 794edf159..ad20d52f7 100644
--- a/tests/unit/test_external_bangs.py
+++ b/tests/unit/test_external_bangs.py
@@ -1,3 +1,6 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# pylint: disable=missing-module-docstring
+
from searx.external_bang import (
get_node,
resolve_bang_definition,
@@ -31,9 +34,9 @@ TEST_DB = {
}
-class TestGetNode(SearxTestCase):
+class TestGetNode(SearxTestCase): # pylint: disable=missing-class-docstring
- DB = {
+ DB = { # pylint:disable=invalid-name
'trie': {
'exam': {
'ple': 'test',
@@ -62,7 +65,7 @@ class TestGetNode(SearxTestCase):
self.assertEqual(after, 's')
-class TestResolveBangDefinition(SearxTestCase):
+class TestResolveBangDefinition(SearxTestCase): # pylint:disable=missing-class-docstring
def test_https(self):
url, rank = resolve_bang_definition('//example.com/' + chr(2) + chr(1) + '42', 'query')
self.assertEqual(url, 'https://example.com/query')
@@ -74,7 +77,7 @@ class TestResolveBangDefinition(SearxTestCase):
self.assertEqual(rank, 0)
-class TestGetBangDefinitionAndAutocomplete(SearxTestCase):
+class TestGetBangDefinitionAndAutocomplete(SearxTestCase): # pylint:disable=missing-class-docstring
def test_found(self):
bang_definition, new_autocomplete = get_bang_definition_and_autocomplete('exam', external_bangs_db=TEST_DB)
self.assertEqual(bang_definition, TEST_DB['trie']['exam'][LEAF_KEY])
@@ -106,7 +109,7 @@ class TestGetBangDefinitionAndAutocomplete(SearxTestCase):
self.assertEqual(new_autocomplete, [])
-class TestExternalBangJson(SearxTestCase):
+class TestExternalBangJson(SearxTestCase): # pylint:disable=missing-class-docstring
def test_no_external_bang_query(self):
result = get_bang_url(SearchQuery('test', engineref_list=[EngineRef('wikipedia', 'general')]))
self.assertEqual(result, None)