merge fix
This commit is contained in:
commit
357029865f
72 changed files with 2282 additions and 2558 deletions
|
|
@ -10,6 +10,10 @@ import orjson
|
|||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from httpx import AsyncClient
|
||||
from sqlmodel import Session, SQLModel, create_engine, select
|
||||
from sqlmodel.pool import StaticPool
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from langflow.graph.graph.base import Graph
|
||||
from langflow.initial_setup.setup import STARTER_FOLDER_NAME
|
||||
from langflow.services.auth.utils import get_password_hash
|
||||
|
|
@ -380,7 +384,7 @@ def get_starter_project(active_user):
|
|||
# once the client is created, we can get the starter project
|
||||
with session_getter(get_db_service()) as session:
|
||||
flow = session.exec(
|
||||
select(Flow).where(Flow.folder == STARTER_FOLDER_NAME).where(Flow.name == "Basic Prompting (Ahoy World!)")
|
||||
select(Flow).where(Flow.folder == STARTER_FOLDER_NAME).where(Flow.name == "Basic Prompting (Hello, world!)")
|
||||
).first()
|
||||
if not flow:
|
||||
raise ValueError("No starter project found")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ from uuid import uuid4
|
|||
import pytest
|
||||
from fastapi import status
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from langflow.interface.custom.directory_reader.directory_reader import DirectoryReader
|
||||
from langflow.services.deps import get_settings_service
|
||||
from langflow.template.frontend_node.chains import TimeTravelGuideChainNode
|
||||
|
|
@ -447,8 +446,8 @@ def test_successful_run_no_payload(client, starter_project, created_api_key):
|
|||
display_names = [output.get("component_display_name") for output in outputs_dict.get("outputs")]
|
||||
assert all([name in display_names for name in ["Chat Output"]])
|
||||
inner_results = [output.get("results").get("result") for output in outputs_dict.get("outputs")]
|
||||
expected_result = "Langflow"
|
||||
assert all([expected_result in result for result in inner_results]), inner_results
|
||||
|
||||
assert all([len(result) > 0 for result in inner_results]), inner_results
|
||||
|
||||
|
||||
def test_successful_run_with_output_type_text(client, starter_project, created_api_key):
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ def test_text_to_record_component():
|
|||
|
||||
# Act
|
||||
# Replace with your actual test data
|
||||
dict_with_text = {"key": "value"}
|
||||
result = text_to_record_component.build(dict_with_text)
|
||||
dict_with_text = {"field_1": {"key": "value"}}
|
||||
result = text_to_record_component.build(number_of_fields=1, **dict_with_text)
|
||||
|
||||
# Assert
|
||||
# Replace with your actual expected result
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import func
|
||||
from sqlmodel import select
|
||||
|
||||
from langflow.graph.graph.base import Graph
|
||||
from langflow.graph.schema import RunOutputs
|
||||
from langflow.initial_setup.setup import (
|
||||
|
|
@ -15,6 +12,8 @@ from langflow.initial_setup.setup import (
|
|||
from langflow.memory import delete_messages
|
||||
from langflow.services.database.models.flow.model import Flow
|
||||
from langflow.services.deps import session_scope
|
||||
from sqlalchemy import func
|
||||
from sqlmodel import select
|
||||
|
||||
|
||||
def test_load_starter_projects():
|
||||
|
|
@ -78,7 +77,9 @@ async def test_starter_project_can_run_successfully(client):
|
|||
projects = session.exec(select(Flow).where(Flow.folder == STARTER_FOLDER_NAME)).all()
|
||||
|
||||
graphs: list[tuple[str, Graph]] = [
|
||||
(project.name, Graph.from_payload(project.data, flow_id=project.id)) for project in projects
|
||||
(project.name, Graph.from_payload(project.data, flow_id=project.id))
|
||||
for project in projects
|
||||
if "Document" not in project.name or "RAG" not in project.name
|
||||
]
|
||||
assert len(graphs) == len(projects)
|
||||
for name, graph in graphs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue