Fix test_template.py: Update build_template_from_function and test_format_dict
This commit is contained in:
parent
8502898032
commit
97fa69e535
1 changed files with 3 additions and 5 deletions
|
|
@ -65,11 +65,9 @@ def test_build_template_from_function():
|
||||||
assert "base_classes" in result
|
assert "base_classes" in result
|
||||||
|
|
||||||
# Test with add_function=True
|
# Test with add_function=True
|
||||||
result_with_function = build_template_from_function(
|
result_with_function = build_template_from_function("ExampleClass1", type_to_loader_dict, add_function=True)
|
||||||
"ExampleClass1", type_to_loader_dict, add_function=True
|
|
||||||
)
|
|
||||||
assert result_with_function is not None
|
assert result_with_function is not None
|
||||||
assert "function" in result_with_function["base_classes"]
|
assert "Callable" in result_with_function["base_classes"]
|
||||||
|
|
||||||
# Test with invalid name
|
# Test with invalid name
|
||||||
with pytest.raises(ValueError, match=r".* not found"):
|
with pytest.raises(ValueError, match=r".* not found"):
|
||||||
|
|
@ -237,7 +235,7 @@ def test_format_dict():
|
||||||
"password": False,
|
"password": False,
|
||||||
"multiline": False,
|
"multiline": False,
|
||||||
"options": CHAT_OPENAI_MODELS,
|
"options": CHAT_OPENAI_MODELS,
|
||||||
"value": "gpt-4-1106-preview"",
|
"value": "gpt-4-1106-preview",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
assert format_dict(input_dict, "OpenAI") == expected_output_openai
|
assert format_dict(input_dict, "OpenAI") == expected_output_openai
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue