|
@@ -18,7 +18,7 @@ class TestArchLinuxEngine(SearxTestCase):
|
18
|
18
|
def test_request(self):
|
19
|
19
|
query = 'test_query'
|
20
|
20
|
dic = defaultdict(dict)
|
21
|
|
- dic['pageno'] = 0
|
|
21
|
+ dic['pageno'] = 1
|
22
|
22
|
dic['language'] = 'en_US'
|
23
|
23
|
params = archlinux.request(query, dic)
|
24
|
24
|
self.assertTrue('url' in params)
|
|
@@ -31,10 +31,8 @@ class TestArchLinuxEngine(SearxTestCase):
|
31
|
31
|
self.assertTrue(domain in params['url'])
|
32
|
32
|
|
33
|
33
|
def test_response(self):
|
34
|
|
- response = mock.Mock(text='<html></html>')
|
35
|
|
- response.search_params = {
|
36
|
|
- 'language': 'en_US'
|
37
|
|
- }
|
|
34
|
+ response = mock.Mock(text='<html></html>',
|
|
35
|
+ search_params={'language': 'en_US'})
|
38
|
36
|
self.assertEqual(archlinux.response(response), [])
|
39
|
37
|
|
40
|
38
|
html = """
|
|
@@ -79,18 +77,15 @@ class TestArchLinuxEngine(SearxTestCase):
|
79
|
77
|
expected = [
|
80
|
78
|
{
|
81
|
79
|
'title': 'ATI',
|
82
|
|
- 'url': 'https://wiki.archlinux.org/index.php/ATI',
|
83
|
|
- 'content': 'Lorem ipsum dolor sit amet'
|
|
80
|
+ 'url': 'https://wiki.archlinux.org/index.php/ATI'
|
84
|
81
|
},
|
85
|
82
|
{
|
86
|
83
|
'title': 'Frequently asked questions',
|
87
|
|
- 'url': 'https://wiki.archlinux.org/index.php/Frequently_asked_questions',
|
88
|
|
- 'content': 'CPUs with AMDs instruction set "AMD64"'
|
|
84
|
+ 'url': 'https://wiki.archlinux.org/index.php/Frequently_asked_questions'
|
89
|
85
|
},
|
90
|
86
|
{
|
91
|
87
|
'title': 'CPU frequency scaling',
|
92
|
|
- 'url': 'https://wiki.archlinux.org/index.php/CPU_frequency_scaling',
|
93
|
|
- 'content': 'ondemand for AMD and older Intel CPU'
|
|
88
|
+ 'url': 'https://wiki.archlinux.org/index.php/CPU_frequency_scaling'
|
94
|
89
|
}
|
95
|
90
|
]
|
96
|
91
|
|