feat: added more graph tests
This commit is contained in:
parent
269c06e9c1
commit
b4963572b0
2 changed files with 74 additions and 9 deletions
|
|
@ -11,12 +11,12 @@ from langflow.interface.loading import load_langchain_type_from_config
|
|||
|
||||
def test_load_flow_from_json():
|
||||
"""Test loading a flow from a json file"""
|
||||
loaded = load_flow_from_json(pytest.EXAMPLE_JSON_PATH)
|
||||
loaded = load_flow_from_json(pytest.BASIC_EXAMPLE_PATH)
|
||||
assert loaded is not None
|
||||
|
||||
|
||||
def test_extract_json():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
extracted = extract_json(data_graph)
|
||||
|
|
@ -25,7 +25,7 @@ def test_extract_json():
|
|||
|
||||
|
||||
def test_get_root_node():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
nodes = data_graph["nodes"]
|
||||
|
|
@ -38,7 +38,7 @@ def test_get_root_node():
|
|||
|
||||
|
||||
def test_build_json():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
nodes = data_graph["nodes"]
|
||||
|
|
@ -51,7 +51,7 @@ def test_build_json():
|
|||
|
||||
|
||||
def test_build_json_missing_child():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
nodes = data_graph["nodes"]
|
||||
|
|
@ -76,7 +76,7 @@ def test_build_json_no_nodes():
|
|||
|
||||
|
||||
def test_build_json_invalid_edge():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
nodes = data_graph["nodes"]
|
||||
|
|
@ -92,7 +92,7 @@ def test_build_json_invalid_edge():
|
|||
|
||||
|
||||
def test_load_langchain_type_from_config():
|
||||
with open(pytest.EXAMPLE_JSON_PATH, "r") as f:
|
||||
with open(pytest.BASIC_EXAMPLE_PATH, "r") as f:
|
||||
flow_graph = json.load(f)
|
||||
data_graph = flow_graph["data"]
|
||||
extracted = extract_json(data_graph)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue