From b6c3cb0bdd020a459d0ef5c21d1303ed0148cc0c Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 3 Oct 2015 17:26:07 +0200 Subject: [enh][mod] result handling refactor Several changes has been made: - Parallel result merge - Scoring algorithm slightly changed (see result_score()) - Proper Thread locking on global data manipulation --- searx/tests/test_webapp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'searx/tests/test_webapp.py') diff --git a/searx/tests/test_webapp.py b/searx/tests/test_webapp.py index 471ec2f2d..1d9cc649c 100644 --- a/searx/tests/test_webapp.py +++ b/searx/tests/test_webapp.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import json +from mock import Mock from urlparse import ParseResult from searx import webapp from searx.testing import SearxTestCase @@ -33,7 +34,12 @@ class ViewsTestCase(SearxTestCase): ] def search_mock(search_self, *args): - search_self.results = self.test_results + search_self.result_container = Mock(get_ordered_results=lambda: self.test_results, + answers=set(), + suggestions=set(), + infoboxes=[], + results=self.test_results, + results_length=lambda: len(self.test_results)) webapp.Search.search = search_mock -- cgit v1.2.3