1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 19:00:10 +01:00

Fix string length

This commit is contained in:
rinpatch 2018-04-23 12:55:25 +03:00
parent c40d8e1d15
commit 06e070aee2

View File

@ -30,8 +30,20 @@ class TestCurrencyConvertEngine(SearxTestCase):
dicto['to_name'] = "United States dollar" dicto['to_name'] = "United States dollar"
response = mock.Mock(text='a,b,c,d', search_params=dicto) response = mock.Mock(text='a,b,c,d', search_params=dicto)
self.assertEqual(currency_convert.response(response), []) self.assertEqual(currency_convert.response(response), [])
body = """ddg_spice_currency(
body = "ddg_spice_currency(\n{\n\"conversion\":{\n\"converted-amount\": \"0.5\"\n}\n\"topConversions\":[\n{\n},\n{\n}\n]\n}\n);" {
"conversion":{
"converted-amount": "0.5"
},
"topConversions":[
{
},
{
}
]
}
);
"""
response = mock.Mock(text=body, search_params=dicto) response = mock.Mock(text=body, search_params=dicto)
results = currency_convert.response(response) results = currency_convert.response(response)
self.assertEqual(type(results), list) self.assertEqual(type(results), list)