forked from Ponysearch/Ponysearch
[fix] tests
This commit is contained in:
parent
8806002886
commit
043b269c6e
4 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ safesearch = True
|
||||||
# search-url
|
# search-url
|
||||||
base_url = 'https://www.bing.com/'
|
base_url = 'https://www.bing.com/'
|
||||||
search_string = 'images/search?{query}&count=10&first={offset}'
|
search_string = 'images/search?{query}&count=10&first={offset}'
|
||||||
thumb_url = "http://ts1.mm.bing.net/th?id={ihk}" # no https, bad certificate
|
thumb_url = "http://ts1.mm.bing.net/th?id={ihk}" # no https, bad certificate
|
||||||
|
|
||||||
# safesearch definitions
|
# safesearch definitions
|
||||||
safesearch_types = {2: 'STRICT',
|
safesearch_types = {2: 'STRICT',
|
||||||
|
|
|
@ -40,5 +40,5 @@ class TestCurrencyConvertEngine(SearxTestCase):
|
||||||
self.assertEqual(len(results), 1)
|
self.assertEqual(len(results), 1)
|
||||||
self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)')
|
self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)')
|
||||||
now_date = datetime.now().strftime('%Y%m%d')
|
now_date = datetime.now().strftime('%Y%m%d')
|
||||||
self.assertEqual(results[0]['url'], 'http://finance.yahoo.com/currency/converter-results/' +
|
self.assertEqual(results[0]['url'], 'https://finance.yahoo.com/currency/converter-results/' +
|
||||||
now_date + '/10-eur-to-usd.html')
|
now_date + '/10-eur-to-usd.html')
|
||||||
|
|
|
@ -64,7 +64,7 @@ class TestStackoverflowEngine(SearxTestCase):
|
||||||
self.assertEqual(type(results), list)
|
self.assertEqual(type(results), list)
|
||||||
self.assertEqual(len(results), 1)
|
self.assertEqual(len(results), 1)
|
||||||
self.assertEqual(results[0]['title'], 'This is the title')
|
self.assertEqual(results[0]['title'], 'This is the title')
|
||||||
self.assertEqual(results[0]['url'], 'http://stackoverflow.com/questions/this.is.the.url')
|
self.assertEqual(results[0]['url'], 'https://stackoverflow.com/questions/this.is.the.url')
|
||||||
self.assertEqual(results[0]['content'], 'This is the content')
|
self.assertEqual(results[0]['content'], 'This is the content')
|
||||||
|
|
||||||
html = """
|
html = """
|
||||||
|
|
|
@ -52,7 +52,7 @@ class TestVimeoEngine(SearxTestCase):
|
||||||
self.assertEqual(type(results), list)
|
self.assertEqual(type(results), list)
|
||||||
self.assertEqual(len(results), 1)
|
self.assertEqual(len(results), 1)
|
||||||
self.assertEqual(results[0]['title'], 'This is the title')
|
self.assertEqual(results[0]['title'], 'This is the title')
|
||||||
self.assertEqual(results[0]['url'], 'http://vimeo.com/videoid')
|
self.assertEqual(results[0]['url'], 'https://vimeo.com/videoid')
|
||||||
self.assertEqual(results[0]['content'], '')
|
self.assertEqual(results[0]['content'], '')
|
||||||
self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp')
|
self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp')
|
||||||
self.assertIn('/videoid', results[0]['embedded'])
|
self.assertIn('/videoid', results[0]['embedded'])
|
||||||
|
|
Loading…
Reference in a new issue