From 6c9a89a3a008038ab046ad05f4f6eb6f8e3aff34 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Tue, 13 Aug 2024 15:04:31 +0800 Subject: [PATCH] minor: add unit tests --- tests/template/test_template.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/template/test_template.py b/tests/template/test_template.py index ac09893..81f0bd9 100644 --- a/tests/template/test_template.py +++ b/tests/template/test_template.py @@ -81,6 +81,9 @@ def test_render(): nested_dict_template = Template("${a[0][3]['a']}") assert nested_dict_template.render({"a": [[1, 2, 3, {"a": [1,2,3]}], [5, 6, 7, 8]]}) == [1,2,3] + type_error_template = Template("${a[1]}") + assert type_error_template.render({"a": 1}) == "${a[1]}" + Settings.ENABLE_RENDER_OBJ_BY_MAKO_STRING = default_enable_value