瀏覽代碼

Fix string length

rinpatch 6 年之前
父節點
當前提交
06e070aee2
共有 1 個檔案被更改,包括 14 行新增2 行删除
  1. 14
    2
      tests/unit/engines/test_currency_convert.py

+ 14
- 2
tests/unit/engines/test_currency_convert.py 查看文件

@@ -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)