diff options
author | Adam Tauber <asciimoo@gmail.com> | 2015-05-24 15:09:49 -0400 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2015-05-24 15:09:49 -0400 |
commit | 3035e14007ebf19e2ae7e5d6e82e6587b90a7551 (patch) | |
tree | f547bfb05aef5261f9c4d79895bf0cd5d76dabae /searx/tests | |
parent | c5135f690d34d6a9a3d26b9e0418a54b7e78cdf5 (diff) | |
parent | 5525625daec57934420feded2a692cecdd4c9c9b (diff) | |
download | searxng-3035e14007ebf19e2ae7e5d6e82e6587b90a7551.tar.gz searxng-3035e14007ebf19e2ae7e5d6e82e6587b90a7551.zip |
Merge pull request #320 from dalf/currency
[enh] currency_convert engine : "1 dollars in euros"
Diffstat (limited to 'searx/tests')
-rw-r--r-- | searx/tests/engines/test_currency_convert.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/searx/tests/engines/test_currency_convert.py b/searx/tests/engines/test_currency_convert.py index 579c5cc1f..84ec3b742 100644 --- a/searx/tests/engines/test_currency_convert.py +++ b/searx/tests/engines/test_currency_convert.py @@ -27,9 +27,11 @@ class TestCurrencyConvertEngine(SearxTestCase): def test_response(self): dicto = defaultdict(dict) - dicto['ammount'] = 10 + dicto['ammount'] = float(10) dicto['from'] = "EUR" dicto['to'] = "USD" + dicto['from_name'] = "euro" + dicto['to_name'] = "United States dollar" response = mock.Mock(text='a,b,c,d', search_params=dicto) self.assertEqual(currency_convert.response(response), []) @@ -38,7 +40,7 @@ class TestCurrencyConvertEngine(SearxTestCase): results = currency_convert.response(response) self.assertEqual(type(results), list) self.assertEqual(len(results), 1) - self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)') + self.assertEqual(results[0]['answer'], '10.0 EUR = 5.0 USD, 1 EUR (euro) = 0.5 USD (United States dollar)') now_date = datetime.now().strftime('%Y%m%d') self.assertEqual(results[0]['url'], 'https://finance.yahoo.com/currency/converter-results/' + - now_date + '/10-eur-to-usd.html') + now_date + '/10.0-eur-to-usd.html') |