@@ -124,16 +124,16 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
124124 results = wolframalpha_noapi.response(response)
125125 self.assertEqual(type(results), list)
126126 self.assertEqual(len(results), 2)
127− self.assertIn('input_plaintext', results[0]['infobox'])
127+ self.assertEqual('input_plaintext', results[0]['infobox'])
128128
129129 self.assertEqual(len(results[0]['attributes']), 3)
130− self.assertIn('Input', results[0]['attributes'][0]['label'])
131− self.assertIn('input_plaintext', results[0]['attributes'][0]['value'])
132− self.assertIn('Result', results[0]['attributes'][1]['label'])
133− self.assertIn('result_plaintext', results[0]['attributes'][1]['value'])
134− self.assertIn('Manipulatives illustration', results[0]['attributes'][2]['label'])
135− self.assertIn('illustration_img_src.gif', results[0]['attributes'][2]['image']['src'])
136− self.assertIn('illustration_img_alt', results[0]['attributes'][2]['image']['alt'])
130+ self.assertEqual('Input', results[0]['attributes'][0]['label'])
131+ self.assertEqual('input_plaintext', results[0]['attributes'][0]['value'])
132+ self.assertEqual('Result', results[0]['attributes'][1]['label'])
133+ self.assertEqual('result_plaintext', results[0]['attributes'][1]['value'])
134+ self.assertEqual('Manipulatives illustration', results[0]['attributes'][2]['label'])
135+ self.assertEqual('illustration_img_src.gif', results[0]['attributes'][2]['image']['src'])
136+ self.assertEqual('illustration_img_alt', results[0]['attributes'][2]['image']['alt'])
137137
138138 self.assertEqual(len(results[0]['urls']), 1)
139139
@@ -184,8 +184,19 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
184184 ],
185185 "id" : "Plot",
186186 "error" : false,
187− "numsubpods" : 0,
188− "async" : "invalid_async_url"
187+ "numsubpods" : 1,
188+ "subpods" : [
189+ {
190+ "title" : "",
191+ "img" : {
192+ "src" : "plot.gif",
193+ "alt" : "plot_alt",
194+ "title" : "plot_title"
195+ },
196+ "plaintext" : "",
197+ "minput" : "plot_minput"
198+ }
199+ ]
189200 }
190201 ]
191202 }}
@@ -194,11 +205,14 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
194205 results = wolframalpha_noapi.response(response)
195206 self.assertEqual(type(results), list)
196207 self.assertEqual(len(results), 2)
197− self.assertIn('integral_plaintext', results[0]['infobox'])
208+ self.assertEqual('integral_plaintext', results[0]['infobox'])
198209
199− self.assertEqual(len(results[0]['attributes']), 1)
200− self.assertIn('Indefinite integral', results[0]['attributes'][0]['label'])
201− self.assertIn('integral_plaintext', results[0]['attributes'][0]['value'])
210+ self.assertEqual(len(results[0]['attributes']), 2)
211+ self.assertEqual('Indefinite integral', results[0]['attributes'][0]['label'])
212+ self.assertEqual('integral_plaintext', results[0]['attributes'][0]['value'])
213+ self.assertEqual('Plot of the integral', results[0]['attributes'][1]['label'])
214+ self.assertEqual('plot.gif', results[0]['attributes'][1]['image']['src'])
215+ self.assertEqual('plot_alt', results[0]['attributes'][1]['image']['alt'])
202216
203217 self.assertEqual(len(results[0]['urls']), 1)
204218
@@ -206,33 +220,3 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
206220 self.assertEqual('Wolfram|Alpha', results[0]['urls'][0]['title'])
207221 self.assertEqual(referer_url, results[1]['url'])
208222 self.assertEqual('Wolfram|Alpha', results[1]['title'])
209−
210− def test_parse_async_pod(self):
211− self.assertRaises(AttributeError, wolframalpha_noapi.parse_async_pod, None)
212− self.assertRaises(AttributeError, wolframalpha_noapi.parse_async_pod, [])
213− self.assertRaises(AttributeError, wolframalpha_noapi.parse_async_pod, '')
214− self.assertRaises(AttributeError, wolframalpha_noapi.parse_async_pod, '[]')
215−
216− # test plot
217− xml = '''<?xml version='1.0' encoding='UTF-8'?>
218− <pod title='Plot'
219− scanner='Plot'
220− id='Plot'
221− error='false'
222− numsubpods='1'>
223− <subpod title=''>
224− <img src='plot_img_src.gif'
225− alt='plot_img_alt'
226− title='plot_img_title' />
227− <plaintext>plot_plaintext</plaintext>
228− <minput>plot_minput</minput>
229− </subpod>
230− </pod>
231− '''
232− response = mock.Mock(content=xml)
233− pod = wolframalpha_noapi.parse_async_pod(response)
234− self.assertEqual(len(pod['subpods']), 1)
235− self.assertEqual('', pod['subpods'][0]['title'])
236− self.assertEqual('plot_plaintext', pod['subpods'][0]['plaintext'])
237− self.assertEqual('plot_img_src.gif', pod['subpods'][0]['img']['src'])
238− self.assertEqual('plot_img_alt', pod['subpods'][0]['img']['alt'])