@@ -636,18 +636,18 @@ def test_format_normal_messages_null_message(prompt_provider):
636636 assert result [1 ].role == Role .USER
637637 assert result [1 ].content == "World"
638638def test_validate_variable_values_type_boolean_valid (prompt_provider ):
639- """测试有效的 boolean 类型变量 """
639+ """Test valid boolean type variable """
640640 var_defs = [VariableDef (key = "enabled" , desc = "Enable feature" , type = VariableType .BOOLEAN )]
641641 variables = {"enabled" : True }
642642
643- # 应该不抛出异常
643+ # Should not raise exception
644644 prompt_provider ._validate_variable_values_type (var_defs , variables )
645645
646646
647647def test_validate_variable_values_type_boolean_invalid (prompt_provider ):
648- """测试无效的 boolean 类型变量 """
648+ """Test invalid boolean type variable """
649649 var_defs = [VariableDef (key = "enabled" , desc = "Enable feature" , type = VariableType .BOOLEAN )]
650- variables = {"enabled" : "true" } # 字符串而不是布尔值
650+ variables = {"enabled" : "true" } # String instead of boolean
651651
652652 with pytest .raises (ValueError ) as excinfo :
653653 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -656,18 +656,18 @@ def test_validate_variable_values_type_boolean_invalid(prompt_provider):
656656
657657
658658def test_validate_variable_values_type_integer_valid (prompt_provider ):
659- """测试有效的 integer 类型变量 """
659+ """Test valid integer type variable """
660660 var_defs = [VariableDef (key = "count" , desc = "Item count" , type = VariableType .INTEGER )]
661661 variables = {"count" : 42 }
662662
663- # 应该不抛出异常
663+ # Should not raise exception
664664 prompt_provider ._validate_variable_values_type (var_defs , variables )
665665
666666
667667def test_validate_variable_values_type_integer_invalid (prompt_provider ):
668- """测试无效的 integer 类型变量 """
668+ """Test invalid integer type variable """
669669 var_defs = [VariableDef (key = "count" , desc = "Item count" , type = VariableType .INTEGER )]
670- variables = {"count" : "42" } # 字符串而不是整数
670+ variables = {"count" : "42" } # String instead of integer
671671
672672 with pytest .raises (ValueError ) as excinfo :
673673 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -676,18 +676,18 @@ def test_validate_variable_values_type_integer_invalid(prompt_provider):
676676
677677
678678def test_validate_variable_values_type_float_valid (prompt_provider ):
679- """测试有效的 float 类型变量 """
679+ """Test valid float type variable """
680680 var_defs = [VariableDef (key = "temperature" , desc = "Temperature value" , type = VariableType .FLOAT )]
681681 variables = {"temperature" : 3.14 }
682682
683- # 应该不抛出异常
683+ # Should not raise exception
684684 prompt_provider ._validate_variable_values_type (var_defs , variables )
685685
686686
687687def test_validate_variable_values_type_float_invalid (prompt_provider ):
688- """测试无效的 float 类型变量 """
688+ """Test invalid float type variable """
689689 var_defs = [VariableDef (key = "temperature" , desc = "Temperature value" , type = VariableType .FLOAT )]
690- variables = {"temperature" : "3.14" } # 字符串而不是浮点数
690+ variables = {"temperature" : "3.14" } # String instead of float
691691
692692 with pytest .raises (ValueError ) as excinfo :
693693 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -696,18 +696,18 @@ def test_validate_variable_values_type_float_invalid(prompt_provider):
696696
697697
698698def test_validate_variable_values_type_array_string_valid (prompt_provider ):
699- """测试有效的 array<string> 类型变量 """
699+ """Test valid array<string> type variable """
700700 var_defs = [VariableDef (key = "tags" , desc = "Tag list" , type = VariableType .ARRAY_STRING )]
701701 variables = {"tags" : ["tag1" , "tag2" , "tag3" ]}
702702
703- # 应该不抛出异常
703+ # Should not raise exception
704704 prompt_provider ._validate_variable_values_type (var_defs , variables )
705705
706706
707707def test_validate_variable_values_type_array_string_invalid_not_list (prompt_provider ):
708- """测试无效的 array<string> 类型变量 - 不是列表 """
708+ """Test invalid array<string> type variable - not a list """
709709 var_defs = [VariableDef (key = "tags" , desc = "Tag list" , type = VariableType .ARRAY_STRING )]
710- variables = {"tags" : "tag1,tag2,tag3" } # 字符串而不是列表
710+ variables = {"tags" : "tag1,tag2,tag3" } # String instead of list
711711
712712 with pytest .raises (ValueError ) as excinfo :
713713 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -716,9 +716,9 @@ def test_validate_variable_values_type_array_string_invalid_not_list(prompt_prov
716716
717717
718718def test_validate_variable_values_type_array_string_invalid_wrong_element_type (prompt_provider ):
719- """测试无效的 array<string> 类型变量 - 元素类型错误 """
719+ """Test invalid array<string> type variable - wrong element type """
720720 var_defs = [VariableDef (key = "tags" , desc = "Tag list" , type = VariableType .ARRAY_STRING )]
721- variables = {"tags" : ["tag1" , 123 , "tag3" ]} # 包含非字符串元素
721+ variables = {"tags" : ["tag1" , 123 , "tag3" ]} # Contains non-string elements
722722
723723 with pytest .raises (ValueError ) as excinfo :
724724 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -727,18 +727,18 @@ def test_validate_variable_values_type_array_string_invalid_wrong_element_type(p
727727
728728
729729def test_validate_variable_values_type_array_boolean_valid (prompt_provider ):
730- """测试有效的 array<boolean> 类型变量 """
730+ """Test valid array<boolean> type variable """
731731 var_defs = [VariableDef (key = "flags" , desc = "Boolean flags" , type = VariableType .ARRAY_BOOLEAN )]
732732 variables = {"flags" : [True , False , True ]}
733733
734- # 应该不抛出异常
734+ # Should not raise exception
735735 prompt_provider ._validate_variable_values_type (var_defs , variables )
736736
737737
738738def test_validate_variable_values_type_array_boolean_invalid (prompt_provider ):
739- """测试无效的 array<boolean> 类型变量 """
739+ """Test invalid array<boolean> type variable """
740740 var_defs = [VariableDef (key = "flags" , desc = "Boolean flags" , type = VariableType .ARRAY_BOOLEAN )]
741- variables = {"flags" : [True , "false" , True ]} # 包含字符串而不是布尔值
741+ variables = {"flags" : [True , "false" , True ]} # Contains string instead of boolean
742742
743743 with pytest .raises (ValueError ) as excinfo :
744744 prompt_provider ._validate_variable_values_type (var_defs , variables )
@@ -747,16 +747,16 @@ def test_validate_variable_values_type_array_boolean_invalid(prompt_provider):
747747
748748
749749def test_validate_variable_values_type_array_integer_valid (prompt_provider ):
750- """测试有效的 array<integer> 类型变量 """
750+ """Test valid array<integer> type variable """
751751 var_defs = [VariableDef (key = "numbers" , desc = "Number list" , type = VariableType .ARRAY_INTEGER )]
752752 variables = {"numbers" : [1 , 2 , 3 , 4 , 5 ]}
753753
754- # 应该不抛出异常
754+ # Should not raise exception
755755 prompt_provider ._validate_variable_values_type (var_defs , variables )
756756
757757
758758def test_validate_variable_values_type_array_integer_invalid (prompt_provider ):
759- """测试无效的 array<integer> 类型变量 """
759+ """Test invalid array<integer> type variable """
760760 var_defs = [VariableDef (key = "numbers" , desc = "Number list" , type = VariableType .ARRAY_INTEGER )]
761761 variables = {"numbers" : [1 , "2" , 3 ]} # 包含字符串而不是整数
762762
0 commit comments