@@ -26,19 +26,29 @@ class TestFlickrNoapiEngine(SearxTestCase):
26 self.assertRaises(AttributeError, flickr_noapi.response, '')
26 self.assertRaises(AttributeError, flickr_noapi.response, '')
27 self.assertRaises(AttributeError, flickr_noapi.response, '[]')
27 self.assertRaises(AttributeError, flickr_noapi.response, '[]')
29− response = mock.Mock(text='"search-photos-models","photos":{},"totalItems":')
29+ response = mock.Mock(text='"search-photos-lite-models","photos":{},"totalItems":')
30 self.assertEqual(flickr_noapi.response(response), [])
30 self.assertEqual(flickr_noapi.response(response), [])
32− response = mock.Mock(text='search-photos-models","photos":{"data": []},"totalItems":')
32+ response = mock.Mock(text='search-photos-lite-models","photos":{"data": []},"totalItems":')
33 self.assertEqual(flickr_noapi.response(response), [])
33 self.assertEqual(flickr_noapi.response(response), [])
35+ # everthing is ok test
35 json = """
36 json = """
36− "search-photos-models","photos":
37+ "search-photos-lite-models","photos":
38 "_data": [
39 "_data": [
40− "_flickrModelRegistry": "photo-models",
41+ "_flickrModelRegistry": "photo-lite-models",
41 "title": "This is the title",
42 "title": "This is the title",
44+ "pathAlias": "klink692",
47+ "ownerNsid": "59729010@N00",
42 "sizes": {
52 "sizes": {
44 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_c.jpg",
54 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_c.jpg",
@@ -117,40 +127,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
117 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
127 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
118 "key": "z"
128 "key": "z"
121− "canComment": false,
124− "_flickrModelRegistry": "person-models",
125− "pathAlias": "klink692",
126− "username": "Owner",
132− "default": "//c1.staticflickr.com/9/8108/buddyicons/59729010@N00.jpg?1361642376#59729010@N00"
135− "id": "59729010@N00"
138− "_flickrModelRegistry": "photo-engagement-models",
139− "ownerNsid": "59729010@N00",
145− "description": "Description",
147− "secret": "410f653777",
148− "canAddMeta": false,
156 "fetchedStart": true,
133 "fetchedStart": true,
@@ -168,15 +145,24 @@ class TestFlickrNoapiEngine(SearxTestCase):
168 self.assertIn('k.jpg', results[0]['img_src'])
145 self.assertIn('k.jpg', results[0]['img_src'])
169 self.assertIn('n.jpg', results[0]['thumbnail_src'])
146 self.assertIn('n.jpg', results[0]['thumbnail_src'])
170 self.assertIn('Owner', results[0]['content'])
147 self.assertIn('Owner', results[0]['content'])
171− self.assertIn('Description', results[0]['content'])
149+ # no n size, only the z size
173 json = """
150 json = """
174− "search-photos-models","photos":
151+ "search-photos-lite-models","photos":
176 "_data": [
153 "_data": [
178− "_flickrModelRegistry": "photo-models",
155+ "_flickrModelRegistry": "photo-lite-models",
179 "title": "This is the title",
156 "title": "This is the title",
157+ "username": "Owner",
158+ "pathAlias": "klink692",
159+ "realname": "Owner",
161+ "ownerNsid": "59729010@N00",
162+ "canComment": false,
165+ "id": "14001294434",
180 "sizes": {
166 "sizes": {
182 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_z.jpg",
168 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_z.jpg",
@@ -185,40 +171,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
185 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
171 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_z.jpg",
186 "key": "z"
172 "key": "z"
189− "canComment": false,
192− "_flickrModelRegistry": "person-models",
193− "pathAlias": "klink692",
194− "username": "Owner",
200− "default": "//c1.staticflickr.com/9/8108/buddyicons/59729010@N00.jpg?1361642376#59729010@N00"
203− "id": "59729010@N00"
206− "_flickrModelRegistry": "photo-engagement-models",
207− "ownerNsid": "59729010@N00",
213− "description": "Description",
215− "secret": "410f653777",
216− "canAddMeta": false,
224 "fetchedStart": true,
177 "fetchedStart": true,
@@ -235,15 +188,24 @@ class TestFlickrNoapiEngine(SearxTestCase):
235 self.assertIn('z.jpg', results[0]['img_src'])
188 self.assertIn('z.jpg', results[0]['img_src'])
236 self.assertIn('z.jpg', results[0]['thumbnail_src'])
189 self.assertIn('z.jpg', results[0]['thumbnail_src'])
237 self.assertIn('Owner', results[0]['content'])
190 self.assertIn('Owner', results[0]['content'])
238− self.assertIn('Description', results[0]['content'])
240 json = """
193 json = """
241− "search-photos-models","photos":
194+ "search-photos-lite-models","photos":
243 "_data": [
196 "_data": [
245− "_flickrModelRegistry": "photo-models",
198+ "_flickrModelRegistry": "photo-lite-models",
246 "title": "This is the title",
199 "title": "This is the title",
200+ "username": "Owner",
201+ "pathAlias": "klink692",
202+ "realname": "Owner",
204+ "ownerNsid": "59729010@N00",
205+ "canComment": false,
208+ "id": "14001294434",
247 "sizes": {
209 "sizes": {
249 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
211 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
@@ -252,39 +214,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
252 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
214 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
253 "key": "o"
215 "key": "o"
256− "canComment": false,
259− "_flickrModelRegistry": "person-models",
260− "pathAlias": "klink692",
261− "username": "Owner",
267− "default": "//c1.staticflickr.com/9/8108/buddyicons/59729010@N00.jpg?1361642376#59729010@N00"
270− "id": "59729010@N00"
273− "_flickrModelRegistry": "photo-engagement-models",
274− "ownerNsid": "59729010@N00",
281− "secret": "410f653777",
282− "canAddMeta": false,
290 "fetchedStart": true,
220 "fetchedStart": true,
@@ -302,48 +232,25 @@ class TestFlickrNoapiEngine(SearxTestCase):
302 self.assertIn('o.jpg', results[0]['thumbnail_src'])
232 self.assertIn('o.jpg', results[0]['thumbnail_src'])
303 self.assertIn('Owner', results[0]['content'])
233 self.assertIn('Owner', results[0]['content'])
305 json = """
236 json = """
306− "search-photos-models","photos":
237+ "search-photos-lite-models","photos":
308 "_data": [
239 "_data": [
310− "_flickrModelRegistry": "photo-models",
241+ "_flickrModelRegistry": "photo-lite-models",
311 "title": "This is the title",
242 "title": "This is the title",
312− "sizes": {
243+ "username": "Owner",
314− "canComment": false,
317− "_flickrModelRegistry": "person-models",
318− "pathAlias": "klink692",
244+ "pathAlias": "klink692",
319− "username": "Owner",
245+ "realname": "Owner",
325− "default": "//c1.staticflickr.com/9/8108/buddyicons/59729010@N00.jpg?1361642376#59729010@N00"
328− "id": "59729010@N00"
331− "_flickrModelRegistry": "photo-engagement-models",
332− "ownerNsid": "59729010@N00",
338− "description": "Description",
340− "secret": "410f653777",
341− "canAddMeta": false,
342 "license": 0,
246 "license": 0,
343− "oWidth": 1803,
247+ "ownerNsid": "59729010@N00",
344− "oHeight": 2669,
248+ "canComment": false,
345− "safetyLevel": 0,
249+ "commentCount": 14,
346− "id": "14001294434"
251+ "id": "14001294434",
349 "fetchedStart": true,
256 "fetchedStart": true,
@@ -356,6 +263,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
356 self.assertEqual(type(results), list)
263 self.assertEqual(type(results), list)
357 self.assertEqual(len(results), 0)
264 self.assertEqual(len(results), 0)
359 json = """
267 json = """
360 "search-photos-models","photos":
268 "search-photos-models","photos":
@@ -370,13 +278,22 @@ class TestFlickrNoapiEngine(SearxTestCase):
370 self.assertEqual(type(results), list)
278 self.assertEqual(type(results), list)
371 self.assertEqual(len(results), 0)
279 self.assertEqual(len(results), 0)
373 json = """
282 json = """
374− "search-photos-models","photos":
283+ "search-photos-lite-models","photos":
376 "_data": [
285 "_data": [
378− "_flickrModelRegistry": "photo-models",
287+ "_flickrModelRegistry": "photo-lite-models",
379 "title": "This is the title",
288 "title": "This is the title",
289+ "username": "Owner",
290+ "pathAlias": "klink692",
291+ "realname": "Owner",
293+ "canComment": false,
296+ "id": "14001294434",
380 "sizes": {
297 "sizes": {
382 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
299 "displayUrl": "//farm8.staticflickr.com/7246/14001294434_410f653777_o.jpg",
@@ -385,39 +302,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
385 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
302 "url": "//c4.staticflickr.com/8/7246/14001294434_410f653777_o.jpg",
386 "key": "o"
303 "key": "o"
389− "canComment": false,
392− "_flickrModelRegistry": "person-models",
393− "pathAlias": "klink692",
394− "username": "Owner",
400− "default": "//c1.staticflickr.com/9/8108/buddyicons/59729010@N00.jpg?1361642376#59729010@N00"
405− "_flickrModelRegistry": "photo-engagement-models",
406− "ownerNsid": "59729010@N00",
412− "description": "Description",
414− "secret": "410f653777",
415− "canAddMeta": false,
423 "fetchedStart": true,
308 "fetchedStart": true,
@@ -430,6 +315,7 @@ class TestFlickrNoapiEngine(SearxTestCase):
430 self.assertEqual(type(results), list)
315 self.assertEqual(type(results), list)
431 self.assertEqual(len(results), 0)
316 self.assertEqual(len(results), 0)
433 json = """
319 json = """
434 {"toto":[
320 {"toto":[
435 {"id":200,"name":"Artist Name",
321 {"id":200,"name":"Artist Name",