refactor: move langflow api tests into integration tests (#2469)
This commit is contained in:
parent
4dda82609e
commit
32e12cf72a
3 changed files with 90 additions and 114 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import pytest
|
||||
|
||||
from langflow.graph import Graph
|
||||
from langflow.graph.schema import RunOutputs
|
||||
from langflow.initial_setup.setup import load_starter_projects
|
||||
from langflow.load import load_flow_from_json, run_flow_from_json
|
||||
from langflow.load import load_flow_from_json
|
||||
|
||||
|
||||
@pytest.mark.noclient
|
||||
|
|
@ -30,14 +30,3 @@ def test_load_flow_from_json_object():
|
|||
loaded = load_flow_from_json(project)
|
||||
assert loaded is not None
|
||||
assert isinstance(loaded, Graph)
|
||||
|
||||
|
||||
@pytest.mark.noclient
|
||||
@pytest.mark.api_key_required
|
||||
def test_run_flow_from_json_object():
|
||||
"""Test loading a flow from a json file and applying tweaks"""
|
||||
_, projects = zip(*load_starter_projects())
|
||||
project = [project for project in projects if "Basic Prompting" in project["name"]][0]
|
||||
results = run_flow_from_json(project, input_value="test", fallback_to_env_vars=True)
|
||||
assert results is not None
|
||||
assert all(isinstance(result, RunOutputs) for result in results)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue