diff options
author | Pydo <pydo@tutanota.com> | 2016-10-01 10:46:18 -0400 |
---|---|---|
committer | Pydo <pydo@tutanota.com> | 2016-10-01 10:46:18 -0400 |
commit | 55a5b686ed6dc0b9a6bfc45e0eaf1f70e24f2aea (patch) | |
tree | 96e953057dd3fc29681039f7ac5b282dac189ee8 /tests | |
parent | 6f87bf2a1c76f1b94ad2119df7fb938c2307e370 (diff) | |
parent | 295fc9ce96d8cca9c6c4776a00e5fb0942eb6f4d (diff) | |
download | searxng-55a5b686ed6dc0b9a6bfc45e0eaf1f70e24f2aea.tar.gz searxng-55a5b686ed6dc0b9a6bfc45e0eaf1f70e24f2aea.zip |
Merge branch 'master' of https://github.com/asciimoo/searx into feature/seedpeer-engine-integration
Resolved conflict searx/settings.yml
Diffstat (limited to 'tests')
-rw-r--r-- | tests/robot/test_basic.robot | 8 | ||||
-rw-r--r-- | tests/unit/engines/test_digbt.py | 4 | ||||
-rw-r--r-- | tests/unit/engines/test_wolframalpha_api.py | 6 | ||||
-rw-r--r-- | tests/unit/engines/test_wolframalpha_noapi.py | 6 | ||||
-rw-r--r-- | tests/unit/test_webapp.py | 4 |
5 files changed, 17 insertions, 11 deletions
diff --git a/tests/robot/test_basic.robot b/tests/robot/test_basic.robot index a455eeaa0..ab41265a0 100644 --- a/tests/robot/test_basic.robot +++ b/tests/robot/test_basic.robot @@ -24,8 +24,8 @@ Preferences page Page Should Contain Preferences Page Should Contain Default categories Page Should Contain Currently used search engines - Page Should Contain dummy_dummy - Page Should Contain general_dummy + Page Should Contain dummy dummy + Page Should Contain general dummy Switch category Go To http://localhost:11111/preferences @@ -67,7 +67,7 @@ Change theme Page Should Contain about Page Should Contain preferences Go To http://localhost:11111/preferences - List Selection Should Be theme default + List Selection Should Be theme legacy Select From List theme oscar Submit Form id=search_form Location Should Be http://localhost:11111/ @@ -139,7 +139,7 @@ Block a plugin Page Should Contain about Page Should Contain preferences Go To http://localhost:11111/preferences - List Selection Should Be theme default + List Selection Should Be theme legacy Select From List theme oscar Submit Form id=search_form Location Should Be http://localhost:11111/ diff --git a/tests/unit/engines/test_digbt.py b/tests/unit/engines/test_digbt.py index 867188ed9..31a1b03a4 100644 --- a/tests/unit/engines/test_digbt.py +++ b/tests/unit/engines/test_digbt.py @@ -28,7 +28,9 @@ class TestDigBTEngine(SearxTestCase): <table class="table"> <tr><td class="x-item"> <div> - <a title="The Big Bang Theory" class="title" href="/The-Big-Bang-Theory-d2.html">The Big Bang Theory</a> + <a title="The Big Bang Theory" class="title" href="/The-Big-Bang-Theory-d2.html"> + The Big <span class="highlight">Bang</span> Theory + </a> <span class="ctime"><span style="color:red;">4 hours ago</span></span> </div> <div class="files"> diff --git a/tests/unit/engines/test_wolframalpha_api.py b/tests/unit/engines/test_wolframalpha_api.py index 76404e192..64a64ceb3 100644 --- a/tests/unit/engines/test_wolframalpha_api.py +++ b/tests/unit/engines/test_wolframalpha_api.py @@ -103,7 +103,8 @@ class TestWolframAlphaAPIEngine(SearxTestCase): self.assertEqual(referer_url, results[0]['urls'][0]['url']) self.assertEqual('Wolfram|Alpha', results[0]['urls'][0]['title']) self.assertEqual(referer_url, results[1]['url']) - self.assertEqual('Wolfram|Alpha', results[1]['title']) + self.assertEqual('Wolfram|Alpha (input_plaintext)', results[1]['title']) + self.assertIn('result_plaintext', results[1]['content']) # test calc xml = """<?xml version='1.0' encoding='UTF-8'?> @@ -161,4 +162,5 @@ class TestWolframAlphaAPIEngine(SearxTestCase): self.assertEqual(referer_url, results[0]['urls'][0]['url']) self.assertEqual('Wolfram|Alpha', results[0]['urls'][0]['title']) self.assertEqual(referer_url, results[1]['url']) - self.assertEqual('Wolfram|Alpha', results[1]['title']) + self.assertEqual('Wolfram|Alpha (integral_plaintext)', results[1]['title']) + self.assertIn('integral_plaintext', results[1]['content']) diff --git a/tests/unit/engines/test_wolframalpha_noapi.py b/tests/unit/engines/test_wolframalpha_noapi.py index a8f73470e..982edd9f2 100644 --- a/tests/unit/engines/test_wolframalpha_noapi.py +++ b/tests/unit/engines/test_wolframalpha_noapi.py @@ -140,7 +140,8 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase): self.assertEqual(referer_url, results[0]['urls'][0]['url']) self.assertEqual('Wolfram|Alpha', results[0]['urls'][0]['title']) self.assertEqual(referer_url, results[1]['url']) - self.assertEqual('Wolfram|Alpha', results[1]['title']) + self.assertEqual('Wolfram|Alpha (input_plaintext)', results[1]['title']) + self.assertIn('result_plaintext', results[1]['content']) # test calc json = r""" @@ -219,4 +220,5 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase): self.assertEqual(referer_url, results[0]['urls'][0]['url']) self.assertEqual('Wolfram|Alpha', results[0]['urls'][0]['title']) self.assertEqual(referer_url, results[1]['url']) - self.assertEqual('Wolfram|Alpha', results[1]['title']) + self.assertEqual('Wolfram|Alpha (integral_plaintext)', results[1]['title']) + self.assertIn('integral_plaintext', results[1]['content']) diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index 1762d66b6..912bebc4d 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -44,7 +44,7 @@ class ViewsTestCase(SearxTestCase): webapp.Search.search = search_mock def get_current_theme_name_mock(override=None): - return 'default' + return 'legacy' webapp.get_current_theme_name = get_current_theme_name_mock @@ -58,7 +58,7 @@ class ViewsTestCase(SearxTestCase): def test_index_html(self): result = self.app.post('/', data={'q': 'test'}) self.assertIn( - '<h3 class="result_title"><img width="14" height="14" class="favicon" src="/static/themes/default/img/icons/icon_youtube.ico" alt="youtube" /><a href="http://second.test.xyz" rel="noreferrer">Second <span class="highlight">Test</span></a></h3>', # noqa + '<h3 class="result_title"><img width="14" height="14" class="favicon" src="/static/themes/legacy/img/icons/icon_youtube.ico" alt="youtube" /><a href="http://second.test.xyz" rel="noreferrer">Second <span class="highlight">Test</span></a></h3>', # noqa result.data ) self.assertIn( |