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:
Gabriel Luiz Freitas Almeida 2023-06-23 10:52:55 -03:00
commit c191d893ca

View file

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