summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-04-16 13:29:12 +0200
committerAdam Tauber <asciimoo@gmail.com>2016-04-16 13:29:12 +0200
commit817c74e52317126128c6f8740df01b8bdc51c3cf (patch)
tree8df600014776da58cfa986d7ab1933e7cf9cb902 /tests
parent2661c3ab2140603a254d37d2709fee342026fe7b (diff)
parentd98024c26eb4f3e45643a2d2d8124a0616f863e1 (diff)
Merge pull request #542 from ukwt/fix538
[fix] incorrect URLs in Reddit image search results - closes #538
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/engines/test_reddit.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/engines/test_reddit.py b/tests/unit/engines/test_reddit.py
index 51589e300..9c94f4e2b 100644
--- a/tests/unit/engines/test_reddit.py
+++ b/tests/unit/engines/test_reddit.py
@@ -25,7 +25,8 @@ class TestRedditEngine(SearxTestCase):
"data": {
"children": [{
"data": {
- "url": "http://google.com/",
+ "url": "http://google2.com/",
+ "permalink": "http://google.com/",
"title": "Title number one",
"selftext": "Sample",
"created_utc": 1401219957.0,
@@ -33,7 +34,8 @@ class TestRedditEngine(SearxTestCase):
}
}, {
"data": {
- "url": "https://reddit.com/",
+ "url": "https://reddit2.com/",
+ "permalink": "https://reddit.com/",
"title": "Title number two",
"selftext": "Dominus vobiscum",
"created_utc": 1438792533.0,
@@ -55,6 +57,7 @@ class TestRedditEngine(SearxTestCase):
self.assertEqual(r['url'], 'http://google.com/')
self.assertEqual(r['title'], 'Title number one')
self.assertEqual(r['template'], 'images.html')
+ self.assertEqual(r['img_src'], 'http://google2.com/')
self.assertEqual(r['thumbnail_src'], 'http://image.com/picture.jpg')
# testing second result (self-post)
@@ -65,3 +68,4 @@ class TestRedditEngine(SearxTestCase):
created = datetime.fromtimestamp(1438792533.0)
self.assertEqual(r['publishedDate'], created)
self.assertTrue('thumbnail_src' not in r)
+ self.assertTrue('img_src' not in r)