langflow/src/backend/tests/unit/test_experimental_components.py
Gabriel Luiz Freitas Almeida 6d048b2d2c
refactor: add fixtures for client in test files to speed them up (#3490)
refactor: Add fixtures for client in test files to speed them up
2024-08-22 12:08:47 -07:00

21 lines
486 B
Python

from langflow.components import prototypes
import pytest
@pytest.fixture
def client():
pass
def test_python_function_component():
# Arrange
python_function_component = prototypes.PythonFunctionComponent()
# Act
# function must be a string representation
function = "def function():\n return 'Hello, World!'"
# result is the callable function
result = python_function_component.build(function)
# Assert
assert result() == "Hello, World!"