diff options
author | Alexandre Flament <alex@al-f.net> | 2019-07-17 10:38:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-17 10:38:45 +0200 |
commit | 554a21e1d07f3b434b5097b4e3d49e1403be7527 (patch) | |
tree | e4917091b8e32690256fabf64addfc1ea187ba67 /tests | |
parent | cfcbc3a5c344037fb5423c14223e72578170a234 (diff) | |
download | searxng-554a21e1d07f3b434b5097b4e3d49e1403be7527.tar.gz searxng-554a21e1d07f3b434b5097b4e3d49e1403be7527.zip |
[enh] Add Server-Timing header (#1637)
Server Timing specification: https://www.w3.org/TR/server-timing/
In the browser Dev Tools, focus on the main request, there are the responses per engine in the Timing tab.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_webapp.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index fae1755d6..dcf8b583c 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -33,6 +33,19 @@ class ViewsTestCase(SearxTestCase): }, ] + timings = [ + { + 'engine': 'startpage', + 'total': 0.8, + 'load': 0.7 + }, + { + 'engine': 'youtube', + 'total': 0.9, + 'load': 0.6 + } + ] + def search_mock(search_self, *args): search_self.result_container = Mock(get_ordered_results=lambda: self.test_results, answers=set(), @@ -42,7 +55,8 @@ class ViewsTestCase(SearxTestCase): unresponsive_engines=set(), results=self.test_results, results_number=lambda: 3, - results_length=lambda: len(self.test_results)) + results_length=lambda: len(self.test_results), + get_timings=lambda: timings) Search.search = search_mock |