refactor: move tests folder structure and update pytest commands (#2785)
* refactor: move tests folder to src/backend * chore(Makefile): update pytest commands to run tests from the correct directory paths for unit and integration tests * refactor: update file path in test_custom_component.py The file path in the test_custom_component.py file has been updated to use the correct relative path to the component_multiple_outputs.py file. This change ensures that the test code can access the correct file and improves the reliability of the test.
This commit is contained in:
parent
afdff210b3
commit
0122a50a35
56 changed files with 5 additions and 5 deletions
15
src/backend/tests/unit/text_experimental_components.py
Normal file
15
src/backend/tests/unit/text_experimental_components.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from langflow.components import prototypes
|
||||
|
||||
|
||||
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!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue