summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/engines/test_bing_images.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/unit/engines/test_bing_images.py b/tests/unit/engines/test_bing_images.py
index e65e6cc04..a4efcab58 100644
--- a/tests/unit/engines/test_bing_images.py
+++ b/tests/unit/engines/test_bing_images.py
@@ -53,17 +53,25 @@ class TestBingImagesEngine(SearxTestCase):
<li>
<div>
<div class="imgpt">
- <a m='{"purl":"page_url","murl":"img_url","turl":"thumb_url"}'>
+ <a m='{"purl":"page_url","murl":"img_url","turl":"thumb_url","t":"Page 1 title"}'>
<img src="" alt="alt text" />
</a>
+ <div class="img_info">
+ <span>1 x 1 - jpeg</span>
+ <a>1.example.org</a>
+ </div>
</div>
<div></div>
</div>
<div>
<div class="imgpt">
- <a m='{"purl":"page_url2","murl":"img_url2","turl":"thumb_url2"}'>
+ <a m='{"purl":"page_url2","murl":"img_url2","turl":"thumb_url2","t":"Page 2 title"}'>
<img src="" alt="alt text 2" />
</a>
+ <div class="img_info">
+ <span>2 x 2 - jpeg</span>
+ <a>2.example.org</a>
+ </div>
</div>
</div>
</li>
@@ -72,9 +80,13 @@ class TestBingImagesEngine(SearxTestCase):
<li>
<div>
<div class="imgpt">
- <a m='{"purl":"page_url3","murl":"img_url3","turl":"thumb_url3"}'>
+ <a m='{"purl":"page_url3","murl":"img_url3","turl":"thumb_url3","t":"Page 3 title"}'>
<img src="" alt="alt text 3" />
</a>
+ <div class="img_info">
+ <span>3 x 3 - jpeg</span>
+ <a>3.example.org</a>
+ </div>
</div>
</div>
</li>
@@ -86,11 +98,13 @@ class TestBingImagesEngine(SearxTestCase):
results = bing_images.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 3)
- self.assertEqual(results[0]['title'], 'alt text')
+ self.assertEqual(results[0]['title'], 'Page 1 title')
self.assertEqual(results[0]['url'], 'page_url')
self.assertEqual(results[0]['content'], '')
self.assertEqual(results[0]['thumbnail_src'], 'thumb_url')
self.assertEqual(results[0]['img_src'], 'img_url')
+ self.assertEqual(results[0]['img_format'], '1 x 1 - jpeg')
+ self.assertEqual(results[0]['source'], '1.example.org')
def test_fetch_supported_languages(self):
html = """