Bladeren bron

Fix string length

rinpatch 6 jaren geleden
bovenliggende
commit
06e070aee2
1 gewijzigde bestanden met toevoegingen van 14 en 2 verwijderingen
  1. 14
    2
      tests/unit/engines/test_currency_convert.py

+ 14
- 2
tests/unit/engines/test_currency_convert.py Bestand weergeven

@@ -30,8 +30,20 @@ class TestCurrencyConvertEngine(SearxTestCase):
30 30
         dicto['to_name'] = "United States dollar"
31 31
         response = mock.Mock(text='a,b,c,d', search_params=dicto)
32 32
         self.assertEqual(currency_convert.response(response), [])
33
-
34
-        body = "ddg_spice_currency(\n{\n\"conversion\":{\n\"converted-amount\": \"0.5\"\n}\n\"topConversions\":[\n{\n},\n{\n}\n]\n}\n);"
33
+        body = """ddg_spice_currency(
34
+            {
35
+                "conversion":{
36
+                    "converted-amount": "0.5"
37
+                },
38
+                "topConversions":[
39
+                    {
40
+                    },
41
+                    {
42
+                    }
43
+                ]
44
+            }
45
+        );
46
+        """
35 47
         response = mock.Mock(text=body, search_params=dicto)
36 48
         results = currency_convert.response(response)
37 49
         self.assertEqual(type(results), list)