✅ test(test_template.py): add assertions to test_build_template_from_function
Added assertions to test_build_template_from_function to ensure that the returned result is not None and that the expected keys are present in the result. This improves the reliability of the test and ensures that the function is working as expected.
This commit is contained in:
parent
8cd8449034
commit
c191d893ca
1 changed files with 2 additions and 0 deletions
|
|
@ -59,6 +59,7 @@ def test_build_template_from_function():
|
|||
# Test with valid name
|
||||
result = build_template_from_function("ExampleClass1", type_to_loader_dict)
|
||||
|
||||
assert result is not None
|
||||
assert "template" in result
|
||||
assert "description" in result
|
||||
assert "base_classes" in result
|
||||
|
|
@ -67,6 +68,7 @@ def test_build_template_from_function():
|
|||
result_with_function = build_template_from_function(
|
||||
"ExampleClass1", type_to_loader_dict, add_function=True
|
||||
)
|
||||
assert result_with_function is not None
|
||||
assert "function" in result_with_function["base_classes"]
|
||||
|
||||
# Test with invalid name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue