diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-06-15 04:43:15 -0400 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-06-15 04:43:15 -0400 |
| commit | c9b8c7f8deffce93b920273171a4f8f9d6339ea7 (patch) | |
| tree | 8ff700730767bd681cdeb0d6bd2b8993d2c412eb /searx/tests/engines/test_yahoo_news.py | |
| parent | 1b77befe1fb1dbf82f99db69f857d21a7f0fdd6e (diff) | |
| parent | 0a1a3e7371df02580ad923fa0a4c1f4a7c08d759 (diff) | |
Merge pull request #370 from Cqoicebordel/fix_vimeo
Fix vimeo
Diffstat (limited to 'searx/tests/engines/test_yahoo_news.py')
| -rw-r--r-- | searx/tests/engines/test_yahoo_news.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/searx/tests/engines/test_yahoo_news.py b/searx/tests/engines/test_yahoo_news.py index 94d819d61..4d7fc0a10 100644 --- a/searx/tests/engines/test_yahoo_news.py +++ b/searx/tests/engines/test_yahoo_news.py @@ -29,6 +29,13 @@ class TestYahooNewsEngine(SearxTestCase): self.assertIn('en', params['cookies']['sB']) self.assertIn('en', params['url']) + def test_sanitize_url(self): + url = "test.url" + self.assertEqual(url, yahoo_news.sanitize_url(url)) + + url = "www.yahoo.com/;_ylt=test" + self.assertEqual("www.yahoo.com/", yahoo_news.sanitize_url(url)) + def test_response(self): self.assertRaises(AttributeError, yahoo_news.response, None) self.assertRaises(AttributeError, yahoo_news.response, []) @@ -57,7 +64,17 @@ class TestYahooNewsEngine(SearxTestCase): This is the content </div> </li> - </div> + <li class="first"> + <div class="compTitle"> + <h3> + <a class="yschttl spt" target="_blank"> + </a> + </h3> + </div> + <div class="compText"> + </div> + </li> + </ol> """ response = mock.Mock(text=html) results = yahoo_news.response(response) |