mirror of
https://github.com/searxng/searxng.git
synced 2025-07-12 15:59:21 +02:00
[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>
This commit is contained in:
parent
8205f170ff
commit
542f7d0d7b
118 changed files with 261 additions and 369 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue