mirror of
https://github.com/searxng/searxng.git
synced 2025-08-30 15:10:48 +02:00
tests for _fetch_supported_languages in engines
and refactor method to make it testable without making requests
This commit is contained in:
parent
e0c270bd72
commit
af35eee10b
27 changed files with 387 additions and 3388 deletions
|
@ -80,11 +80,10 @@ def response(resp):
|
|||
|
||||
|
||||
# get supported languages from their site
|
||||
def fetch_supported_languages():
|
||||
def _fetch_supported_languages(resp):
|
||||
supported_languages = {}
|
||||
|
||||
response = get(supported_languages_url)
|
||||
response_json = loads(response.text)
|
||||
response_json = loads(resp.text)
|
||||
|
||||
for language in response_json['list']:
|
||||
supported_languages[language['code']] = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue