From caaabf5023adb4f699ccec54871b4babd466f5d3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 7 Jul 2023 18:23:50 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20refactor(test=5Fgraph.py):=20rem?= =?UTF-8?q?ove=20unused=20imports=20and=20test=20cases=20related=20to=20sp?= =?UTF-8?q?ecific=20vertex=20types=20=F0=9F=94=AC=20test(test=5Fgraph.py):?= =?UTF-8?q?=20remove=20test=20cases=20for=20building=20specific=20vertex?= =?UTF-8?q?=20types=20The=20commit=20removes=20unused=20imports=20and=20te?= =?UTF-8?q?st=20cases=20related=20to=20specific=20vertex=20types=20that=20?= =?UTF-8?q?are=20no=20longer=20used=20in=20the=20codebase.=20This=20improv?= =?UTF-8?q?es=20code=20cleanliness=20and=20reduces=20clutter.=20The=20remo?= =?UTF-8?q?ved=20test=20cases=20were=20for=20building=20specific=20vertex?= =?UTF-8?q?=20types,=20which=20are=20no=20longer=20necessary=20as=20the=20?= =?UTF-8?q?build=20method=20is=20now=20tested=20in=20a=20more=20general=20?= =?UTF-8?q?way.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_graph.py | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/tests/test_graph.py b/tests/test_graph.py index 11f97e044..228bbb4d6 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -9,13 +9,9 @@ from langchain.chains.base import Chain from langchain.llms.fake import FakeListLLM from langflow.graph import Graph from langflow.graph.vertex.types import ( - AgentVertex, - ChainVertex, FileToolVertex, LLMVertex, - PromptVertex, ToolkitVertex, - ToolVertex, WrapperVertex, ) from langflow.processing.process import get_result_and_thought @@ -244,10 +240,9 @@ def test_build_params(basic_graph): assert "memory" in root.params -def test_build(basic_graph, complex_graph): +def test_build(basic_graph): """Test Node's build method""" assert_agent_was_built(basic_graph) - assert_agent_was_built(complex_graph) def assert_agent_was_built(graph): @@ -260,34 +255,6 @@ def assert_agent_was_built(graph): assert isinstance(result, Chain) -def test_agent_node_build(complex_graph): - agent_node = get_node_by_type(complex_graph, AgentVertex) - assert agent_node is not None - built_object = agent_node.build() - assert built_object is not None - - -def test_tool_node_build(complex_graph): - tool_node = get_node_by_type(complex_graph, ToolVertex) - assert tool_node is not None - built_object = tool_node.build() - assert built_object is not None - - -def test_chain_node_build(complex_graph): - chain_node = get_node_by_type(complex_graph, ChainVertex) - assert chain_node is not None - built_object = chain_node.build() - assert built_object is not None - - -def test_prompt_node_build(complex_graph): - prompt_node = get_node_by_type(complex_graph, PromptVertex) - assert prompt_node is not None - built_object = prompt_node.build() - assert built_object is not None - - def test_llm_node_build(basic_graph): llm_node = get_node_by_type(basic_graph, LLMVertex) assert llm_node is not None