refactor: add fixtures for client in test files to speed them up (#3490)

refactor: Add fixtures for client in test files to speed them up
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-22 16:08:47 -03:00 committed by GitHub
commit 6d048b2d2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 44 additions and 50 deletions

View file

@ -5,7 +5,11 @@ from langflow.initial_setup.setup import load_starter_projects
from langflow.load import load_flow_from_json
@pytest.mark.noclient
@pytest.fixture
def client():
pass
def test_load_flow_from_json():
"""Test loading a flow from a json file"""
loaded = load_flow_from_json(pytest.BASIC_EXAMPLE_PATH)
@ -13,7 +17,6 @@ def test_load_flow_from_json():
assert isinstance(loaded, Graph)
@pytest.mark.noclient
def test_load_flow_from_json_with_tweaks():
"""Test loading a flow from a json file and applying tweaks"""
tweaks = {"dndnode_82": {"model_name": "gpt-3.5-turbo-16k-0613"}}
@ -22,7 +25,6 @@ def test_load_flow_from_json_with_tweaks():
assert isinstance(loaded, Graph)
@pytest.mark.noclient
def test_load_flow_from_json_object():
"""Test loading a flow from a json file and applying tweaks"""
_, projects = zip(*load_starter_projects())