|
@@ -25,7 +25,8 @@ class TestRedditEngine(SearxTestCase):
|
25
|
25
|
"data": {
|
26
|
26
|
"children": [{
|
27
|
27
|
"data": {
|
28
|
|
- "url": "http://google.com/",
|
|
28
|
+ "url": "http://google2.com/",
|
|
29
|
+ "permalink": "http://google.com/",
|
29
|
30
|
"title": "Title number one",
|
30
|
31
|
"selftext": "Sample",
|
31
|
32
|
"created_utc": 1401219957.0,
|
|
@@ -33,7 +34,8 @@ class TestRedditEngine(SearxTestCase):
|
33
|
34
|
}
|
34
|
35
|
}, {
|
35
|
36
|
"data": {
|
36
|
|
- "url": "https://reddit.com/",
|
|
37
|
+ "url": "https://reddit2.com/",
|
|
38
|
+ "permalink": "https://reddit.com/",
|
37
|
39
|
"title": "Title number two",
|
38
|
40
|
"selftext": "Dominus vobiscum",
|
39
|
41
|
"created_utc": 1438792533.0,
|
|
@@ -55,6 +57,7 @@ class TestRedditEngine(SearxTestCase):
|
55
|
57
|
self.assertEqual(r['url'], 'http://google.com/')
|
56
|
58
|
self.assertEqual(r['title'], 'Title number one')
|
57
|
59
|
self.assertEqual(r['template'], 'images.html')
|
|
60
|
+ self.assertEqual(r['img_src'], 'http://google2.com/')
|
58
|
61
|
self.assertEqual(r['thumbnail_src'], 'http://image.com/picture.jpg')
|
59
|
62
|
|
60
|
63
|
# testing second result (self-post)
|
|
@@ -65,3 +68,4 @@ class TestRedditEngine(SearxTestCase):
|
65
|
68
|
created = datetime.fromtimestamp(1438792533.0)
|
66
|
69
|
self.assertEqual(r['publishedDate'], created)
|
67
|
70
|
self.assertTrue('thumbnail_src' not in r)
|
|
71
|
+ self.assertTrue('img_src' not in r)
|