diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-03-11 14:06:26 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-03-11 14:55:38 +0100 |
commit | 542f7d0d7bd1a12e1884ba4a1508b40e2514d472 (patch) | |
tree | 5256282b267e494200d02914593457854567fec4 /tests/unit/test_webutils.py | |
parent | 8205f170ff983e5240d32dc17d7fdb526ebe5fe7 (diff) | |
download | searxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.tar.gz searxng-542f7d0d7bd1a12e1884ba4a1508b40e2514d472.zip |
[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_webutils.py')
-rw-r--r-- | tests/unit/test_webutils.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/unit/test_webutils.py b/tests/unit/test_webutils.py index b4395539b..c6c441dab 100644 --- a/tests/unit/test_webutils.py +++ b/tests/unit/test_webutils.py @@ -1,10 +1,12 @@ -# -*- coding: utf-8 -*- +# SPDX-License-Identifier: AGPL-3.0-or-later +# pylint: disable=missing-module-docstring + import mock from searx import webutils from tests import SearxTestCase -class TestWebUtils(SearxTestCase): +class TestWebUtils(SearxTestCase): # pylint: disable=missing-class-docstring def test_prettify_url(self): data = ( ('https://searx.me/', 'https://searx.me/'), @@ -32,6 +34,7 @@ class TestWebUtils(SearxTestCase): query = 'a test' self.assertEqual(webutils.highlight_content(content, query), '<span class="highlight">a</span>') + # pylint: disable=line-too-long data = ( ('" test "', 'a test string', 'a <span class="highlight">test</span> string'), ('"a"', 'this is a test string', 'this is <span class="highlight">a</span> test string'), @@ -67,7 +70,7 @@ class TestWebUtils(SearxTestCase): self.assertEqual(webutils.highlight_content(content, query), expected) -class TestUnicodeWriter(SearxTestCase): +class TestUnicodeWriter(SearxTestCase): # pylint: disable=missing-class-docstring def setUp(self): self.unicode_writer = webutils.CSVWriter(mock.MagicMock()) @@ -82,7 +85,7 @@ class TestUnicodeWriter(SearxTestCase): self.assertEqual(self.unicode_writer.writerow.call_count, len(rows)) -class TestNewHmac(SearxTestCase): +class TestNewHmac(SearxTestCase): # pylint: disable=missing-class-docstring def test_bytes(self): data = b'http://example.com' with self.assertRaises(AttributeError): |