Merge cz/mergeAll to two_edges

This commit is contained in:
ogabrielluiz 2024-06-10 11:31:02 -03:00
commit 735a7e3780
333 changed files with 6448 additions and 2498 deletions

View file

@ -10,6 +10,7 @@ from typing import TYPE_CHECKING, AsyncGenerator
import orjson
import pytest
from dotenv import load_dotenv
from fastapi.testclient import TestClient
from httpx import AsyncClient
from sqlmodel import Session, SQLModel, create_engine, select
@ -30,6 +31,9 @@ if TYPE_CHECKING:
from langflow.services.database.service import DatabaseService
load_dotenv()
def pytest_configure(config):
config.addinivalue_line("markers", "noclient: don't create a client for this test")
data_path = Path(__file__).parent.absolute() / "data"

View file

@ -5,6 +5,7 @@ from unittest.mock import Mock, patch
import httpx
import pytest
import respx
from dictdiffer import diff
from httpx import Response
from langflow.components import data
@ -164,8 +165,8 @@ def test_directory_without_mocks():
assert len(results) == len(projects)
# each result is a Record that contains the content attribute
# each are dict that are exactly the same as one of the projects
for result in results:
assert result.text in projects
for i, result in enumerate(results):
assert result.text in projects, list(diff(result.text, projects[i]))
# in ../docs/docs/components there are many mdx files
# check if the directory component can load them

View file

@ -4,7 +4,6 @@ from uuid import UUID, uuid4
import pytest
from fastapi import status
from fastapi.testclient import TestClient
from langflow.custom.directory_reader.directory_reader import DirectoryReader
from langflow.services.deps import get_settings_service
@ -270,7 +269,9 @@ def test_get_all(client: TestClient, logged_in_headers):
all_names = [component_name for _, components in response.json().items() for component_name in components]
json_response = response.json()
# We need to test the custom nodes
assert len(all_names) == len(files)
assert len(all_names) <= len(
files
) # Less or equal because we might have some files that don't have the dependencies installed
assert "ChatInput" in json_response["inputs"]
assert "Prompt" in json_response["inputs"]
assert "ChatOutput" in json_response["outputs"]