Loading searx/engines/btdigg.py +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ def request(query, params): def response(resp): results = [] dom = html.fromstring(resp.text) dom = html.fromstring(resp.content) search_res = dom.xpath('//div[@id="search_res"]/table/tr') Loading searx/tests/engines/test_btdigg.py +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ class TestBtdiggEngine(SearxTestCase): self.assertRaises(AttributeError, btdigg.response, '') self.assertRaises(AttributeError, btdigg.response, '[]') response = mock.Mock(text='<html></html>') response = mock.Mock(content='<html></html>') self.assertEqual(btdigg.response(response), []) html = """ Loading Loading @@ -82,7 +82,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 1) Loading @@ -101,7 +101,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 0) Loading Loading @@ -367,7 +367,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 5) Loading Loading
searx/engines/btdigg.py +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ def request(query, params): def response(resp): results = [] dom = html.fromstring(resp.text) dom = html.fromstring(resp.content) search_res = dom.xpath('//div[@id="search_res"]/table/tr') Loading
searx/tests/engines/test_btdigg.py +4 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ class TestBtdiggEngine(SearxTestCase): self.assertRaises(AttributeError, btdigg.response, '') self.assertRaises(AttributeError, btdigg.response, '[]') response = mock.Mock(text='<html></html>') response = mock.Mock(content='<html></html>') self.assertEqual(btdigg.response(response), []) html = """ Loading Loading @@ -82,7 +82,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 1) Loading @@ -101,7 +101,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 0) Loading Loading @@ -367,7 +367,7 @@ class TestBtdiggEngine(SearxTestCase): </table> </div> """ response = mock.Mock(text=html) response = mock.Mock(content=html) results = btdigg.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 5) Loading