diff options
author | Kirill Isakov <ukwt@ya.ru> | 2016-03-25 00:38:48 +0600 |
---|---|---|
committer | Kirill Isakov <ukwt@ya.ru> | 2016-03-25 00:38:48 +0600 |
commit | 8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8 (patch) | |
tree | 7e084da807052c86423804242ef0b0ecd3687028 /tests | |
parent | d748b8419ad1ef875f34783bbbcf773ebc4cfb5e (diff) | |
download | searxng-8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8.tar.gz searxng-8b7dc2acb9f670ba65e4b98eb310f04e4c212bd8.zip |
Remove content field from ArchWiki results; reformat code in archlinux.py
Content field in Arch Wiki search results is of no real use, more often
than not it contains no usable information and includes too many markup
tags which make the text unreadable. It is safe to remove it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/engines/test_archlinux.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/tests/unit/engines/test_archlinux.py b/tests/unit/engines/test_archlinux.py index 66959857a..d0009d63a 100644 --- a/tests/unit/engines/test_archlinux.py +++ b/tests/unit/engines/test_archlinux.py @@ -18,7 +18,7 @@ class TestArchLinuxEngine(SearxTestCase): def test_request(self): query = 'test_query' dic = defaultdict(dict) - dic['pageno'] = 0 + dic['pageno'] = 1 dic['language'] = 'en_US' params = archlinux.request(query, dic) self.assertTrue('url' in params) @@ -31,10 +31,8 @@ class TestArchLinuxEngine(SearxTestCase): self.assertTrue(domain in params['url']) def test_response(self): - response = mock.Mock(text='<html></html>') - response.search_params = { - 'language': 'en_US' - } + response = mock.Mock(text='<html></html>', + search_params={'language': 'en_US'}) self.assertEqual(archlinux.response(response), []) html = """ @@ -79,18 +77,15 @@ class TestArchLinuxEngine(SearxTestCase): expected = [ { 'title': 'ATI', - 'url': 'https://wiki.archlinux.org/index.php/ATI', - 'content': 'Lorem ipsum dolor sit amet' + 'url': 'https://wiki.archlinux.org/index.php/ATI' }, { 'title': 'Frequently asked questions', - 'url': 'https://wiki.archlinux.org/index.php/Frequently_asked_questions', - 'content': 'CPUs with AMDs instruction set "AMD64"' + 'url': 'https://wiki.archlinux.org/index.php/Frequently_asked_questions' }, { 'title': 'CPU frequency scaling', - 'url': 'https://wiki.archlinux.org/index.php/CPU_frequency_scaling', - 'content': 'ondemand for AMD and older Intel CPU' + 'url': 'https://wiki.archlinux.org/index.php/CPU_frequency_scaling' } ] |