mirror of
https://github.com/searxng/searxng.git
synced 2025-08-17 01:06:44 +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
|
@ -119,11 +119,10 @@ def response(resp):
|
|||
|
||||
|
||||
# get supported languages from their site
|
||||
def fetch_supported_languages():
|
||||
response = get(supported_languages_url)
|
||||
def _fetch_supported_languages(resp):
|
||||
|
||||
# response is a js file with regions as an embedded object
|
||||
response_page = response.text
|
||||
response_page = resp.text
|
||||
response_page = response_page[response_page.find('regions:{') + 8:]
|
||||
response_page = response_page[:response_page.find('}') + 1]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue