pyrrh0n1c пре 7 година
родитељ
комит
4340c0b16c
2 измењених фајлова са 6 додато и 6 уклоњено
  1. 5
    5
      searx/engines/currency_convert.py
  2. 1
    1
      tests/unit/engines/test_currency_convert.py

+ 5
- 5
searx/engines/currency_convert.py Прегледај датотеку

@@ -44,15 +44,15 @@ def request(query, params):
44 44
         # wrong query
45 45
         return params
46 46
 
47
-    ammount, from_currency, to_currency = m.groups()
48
-    ammount = float(ammount)
47
+    amount, from_currency, to_currency = m.groups()
48
+    amount = float(amount)
49 49
     from_currency = name_to_iso4217(from_currency.strip())
50 50
     to_currency = name_to_iso4217(to_currency.strip())
51 51
 
52 52
     q = (from_currency + to_currency).upper()
53 53
 
54 54
     params['url'] = url.format(from_currency, to_currency)
55
-    params['ammount'] = ammount
55
+    params['amount'] = amount
56 56
     params['from'] = from_currency
57 57
     params['to'] = to_currency
58 58
     params['from_name'] = iso4217_to_name(from_currency, 'en')
@@ -73,9 +73,9 @@ def response(resp):
73 73
         return results
74 74
 
75 75
     answer = '{0} {1} = {2} {3}, 1 {1} ({5}) = {4} {3} ({6})'.format(
76
-        resp.search_params['ammount'],
76
+        resp.search_params['amount'],
77 77
         resp.search_params['from'],
78
-        resp.search_params['ammount'] * conversion_rate,
78
+        resp.search_params['amount'] * conversion_rate,
79 79
         resp.search_params['to'],
80 80
         conversion_rate,
81 81
         resp.search_params['from_name'],

+ 1
- 1
tests/unit/engines/test_currency_convert.py Прегледај датотеку

@@ -23,7 +23,7 @@ class TestCurrencyConvertEngine(SearxTestCase):
23 23
 
24 24
     def test_response(self):
25 25
         dicto = defaultdict(dict)
26
-        dicto['ammount'] = float(10)
26
+        dicto['amount'] = float(10)
27 27
         dicto['from'] = "GBP"
28 28
         dicto['to'] = "USD"
29 29
         dicto['from_name'] = "pound sterling"