chore: refactor and add components integration tests (#3607)
* improve inegration tests * add fixes * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
4ee25359a5
commit
96872f3aa5
32 changed files with 523 additions and 131 deletions
22
src/backend/tests/integration/flows/test_basic_prompting.py
Normal file
22
src/backend/tests/integration/flows/test_basic_prompting.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import pytest
|
||||
|
||||
from langflow.components.inputs import ChatInput
|
||||
from langflow.components.outputs import ChatOutput
|
||||
from langflow.components.prompts import PromptComponent
|
||||
from langflow.graph import Graph
|
||||
from langflow.schema.message import Message
|
||||
from tests.integration.utils import run_flow
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_simple_no_llm():
|
||||
graph = Graph()
|
||||
input = graph.add_component(ChatInput())
|
||||
output = graph.add_component(ChatOutput())
|
||||
component = PromptComponent(template="This is the message: {var1}", var1="")
|
||||
prompt = graph.add_component(component)
|
||||
graph.add_component_edge(input, ("message", "var1"), prompt)
|
||||
graph.add_component_edge(prompt, ("prompt", "input_value"), output)
|
||||
outputs = await run_flow(graph, run_input="hello!")
|
||||
assert isinstance(outputs["message"], Message)
|
||||
assert outputs["message"].text == "This is the message: hello!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue