summaryrefslogtreecommitdiff
path: root/tests/unit
AgeCommit message (Collapse)Author
2022-04-05[fix] add missing territory (country) nameMarkus Heiser
Related-to: https://github.com/searxng/searxng/pull/1029#issuecomment-1086824911 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-04-01[fix] issue when upgrading from werkzeug v2.0.3 to v2.1.0Markus Heiser
In v2.1.0 werkzeug [1] fixed an issue [2] to keep relative redirect locations by default [3]. Since relative locations are returned, we need to fix out test cases to avoid AssertionErrors like this one:: ====================================================================== FAIL: test_index_html_get (tests.unit.test_webapp.ViewsTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/searxng/searxng/tests/unit/test_webapp.py", line 105, in test_index_html_get self.assertEqual(result.location, 'http://localhost/search?q=test') AssertionError: '/search?q=test' != 'http://localhost/search?q=test' - /search?q=test + http://localhost/search?q=test [1] https://werkzeug.palletsprojects.com/ [2] https://github.com/pallets/werkzeug/issues/2352 fixed in [3] https://github.com/pallets/werkzeug/pull/2354 Related-to: https://github.com/searxng/searxng/pull/1039#issuecomment-1085538288 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-19Merge pull request #894 from dalf/simple-aria-1Alexandre Flament
[enh] simple: basic ARIA fixes
2022-03-12[mod] replace /help by /info pages and include pages in project docsMarkus Heiser
This patch implements a bolierplate to share content from info-pages of the SearXNG instance (URL /info) with the project documentation (path /docs/user). The info pages are using Markdown (CommonMark), to include them in the project documentation (reST) the myst-parser [1] is used in the Sphinx-doc build chain. If base_url is known (defined in settings.yml) links to the instance are also inserted into the project documentation:: searxng_extra/docs_prebuild [1] https://www.sphinx-doc.org/en/master/usage/markdown.html Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-03-08[enh] simple: basic ARIA fixesAlexandre Flament
2022-03-05[mod] URL for the static file contains the sha1Alexandre Flament
* allow to cache the static file forever * avoid bugs when the static files are updated but not reloaded
2022-02-26[simple theme] replace Image_layout.js with flexbox CS impl.mrpaulblack
* drop image_layout.js from simple theme * move image_layout.js to oscar theme and delete common js dir (since its empty now) * align top position of image detail modal with bottom position of search header * use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less * display span title underneath each image with a max width of 12rem * increase margin and padding around image article on desktop and tablet * make article height smaller on phone layout (height of 6rem) to display more content on current view * remove content from result, if the title and content matches * use a group that cotains the flex image article, if images are mixed with other categories * fix pylint issues in webapp.py * use the default.html result template in unit tests (thanks @return42)
2022-02-20[fix] changeover of the unit tests to the simple themeMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-02-05Merge pull request #848 from not-my-profile/help-routeAlexandre Flament
Introduce `/help` route
2022-02-04Merge pull request #839 from dalf/docs_searx_utilsMarkus Heiser
[mod] add documentation about searx.utils
2022-02-04preferences: Set autocomplete=off for formMartin Fischer
Otherwise you can change the value of a select, refresh the page and the preferences stay changed, leaving the wrong impression that they were saved.
2022-02-01[enh] introduce /help routeMartin Fischer
Translation will be implemented in the future. For now the "en" in /help/en/<pagename> is hardcoded.
2022-02-01[help] remove link from about.md titleMartin Fischer
Now that about.html extends page_with_header.html it already has a link to the start page and removing the link makes it easier to extract the page title from the Markdown for the following commit.
2022-01-29[mod] add documentation about searx.utilsAlexandre Flament
This module is a toolbox for the engines. Is should be documented. In addition, searx/utils.py is checked by pylint.
2022-01-17[typing] add results.TimingMartin Fischer
2022-01-12[fix] external bangs: don't overwrite Bangs in data trieMarkus Heiser
Bangs with a `*` suffix (e.g. `!!d*`) overwrite Bangs with the same prefix (e.g. `!!d`) [1]. This can be avoid when a non printable character is used to tag a LEAF_KEY. [1] https://github.com/searxng/searxng/pull/740#issuecomment-1010411888 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-01-07Merge pull request #708 from not-my-profile/pref-refactorMartin Fischer
Refactor `preferences`
2022-01-06[refactor] refactor SwitchableSettingMartin Fischer
The previous implementation used two hash sets and a list. ... that's not necessary ... a single hash map suffices. And it's also less error prone ... because the previous data structure allowed a setting to be enabled and disabled at the same time.
2022-01-06[refactor] add type hints & remove Setting._post_initMartin Fischer
Previously the Setting classes used a horrible _post_init hack that prevented proper type checking.
2022-01-06[fix] remove broken ? search operatorMartin Fischer
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.
2022-01-05[mod] upgrade httpx 0.21.2Alexandre Flament
httpx 0.21.2 and httpcore 0.14.4 fix multiple issues: * https://github.com/encode/httpx/releases/tag/0.21.2 * https://github.com/encode/httpcore/releases/tag/0.14.4 so most of the workarounds in searx.network have been removed.
2021-12-28[mod] webutils.py: remove dead codeAlexandre Flament
secret_key can't be bytes (see settings_default.py)
2021-12-27[fix] issues reported by pylintMarkus Heiser
Fix pylint issues from commit (3d96a983) [format.python] initial formatting of the python code Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] disable py code formatting for some hunks of codeMarkus Heiser
Disable the python code formatting from python-black, where the readability of code suffers by formatting. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-26[fix] oscar theme: use SearXNG logo and wordmarkMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-10-29healthcheck endpointIgor Rzegocki
2021-10-12Merge pull request #380 from dalf/fix-339Alexandre Flament
[fix] interface language zh_CN and zh_TW don't work
2021-10-12[mod] locale: use hyphen everywhere except for BabelAlexandre Flament
2021-10-12[fix] fix match_language issue to make zh-TW match to zh-Hant-TWMarc Abonce Seguin
pybabel separates locales with underscores but we use hyphens everywhere babel doesn't directly touch
2021-10-12[enh] verify that Tor proxy works every time searx startsAlexandre Flament
based on @MarcAbonce commit on searx
2021-10-06plugins: refactor initializationAlexandre Flament
add a new function "init" call when the app starts. The function can: * return False to disable the plugin. * modify the Flask app.
2021-10-03Merge pull request #375 from dalf/searxng_extraAlexandre Flament
SearXNG: searx_extra
2021-10-02SearXNG: searxng_extraAlexandre Flament
2021-10-02SearXNG: SEARXNG_SETTINGS_PATHAlexandre Flament
2021-09-30SearXNG: oscar themeAlexandre Flament
2021-09-17[pylint] fix global-variable-not-assigned issuesMarkus Heiser
If there is no write access, there is no need for global. Remove global statement if there is no assignment. global-variable-not-assigned: Using global for names but no assignment is done Used when a variable is defined through the "global" statement but no assignment to this variable is done. In Pylint 2.11 the global-variable-not-assigned checker now catches global variables that are never reassigned in a local scope and catches (reassigned) functions [1][2] [1] https://pylint.pycqa.org/en/latest/whatsnew/2.11.html [2] https://github.com/PyCQA/pylint/issues/1375 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-13[fix] settings - displayed name is SearXNGMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-02[mod] move searx/testing.py to the tests directoryAlexandre Flament
move robot tests to tests.robot manage calls "python -m tests.robot"
2021-08-31[pylint] Pylint 2.10 - fix redundant-u-string-prefixMarkus Heiser
Pylint 2.10 added new default checks [1]: redundant-u-string-prefix: Emitted when the u prefix is added to a string [1] https://pylint.pycqa.org/en/latest/whatsnew/2.10.html [2] https://github.com/PyCQA/pylint/issues/4102 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-17[mod] searx.webapp.get_locale: read locale from the preferencesAlexandre Flament
pre_request already set the locale.
2021-08-03[mod] settings.yml: remove localesAlexandre Flament
There are detected from the searx/translations directory
2021-07-25[mod] use tests/unit/settings/test_settings.yml in unit testsMarkus Heiser
In unit tests settings from searx/settings.yml and the user settings from: unit/settings/test_settings.yml are used. In the latter, settings can be activated that are needed in the unit test but should not activated by default in production. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/user_settings_remove2.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/user_settings_remove.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/user_settings_simple.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/user_settings_keep_only.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/user_settings.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-05[yamllint] tests/unit/settings/syntaxerror_settings.ymlMarkus Heiser
Fixed messages reported by:: make test.yamllint Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01[mod] settings_default: remove searx.search.max_request_timeout global variableAlexandre Flament