MCPcopy Index your code
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_process_success

Function test_process_success

tests/test_generate_answer_node.py:174–187  ·  view source on GitHub ↗

Test that process() successfully generates an answer when both user prompt and content are provided.

(dummy_node_for_process)

Source from the content-addressed store, hash-verified

172
173
174def test_process_success(dummy_node_for_process):
175 """
176 Test that process() successfully generates an answer when both user prompt and content are provided.
177 """
178 state = {
179 "user_prompt": "What is the answer?",
180 "content": "This is some valid context.",
181 }
182 dummy_node_for_process.chain = DummyChain()
183 dummy_node_for_process.invoke_with_timeout = (
184 lambda chain, inputs, timeout: chain.invoke(inputs)
185 )
186 new_state = dummy_node_for_process.process(state)
187 assert new_state["output"] == {"content": "successful answer"}
188
189
190def test_execute_timeout_single_chunk(dummy_node_with_pipe):

Callers

nothing calls this directly

Calls 3

DummyChainClass · 0.85
invokeMethod · 0.80
processMethod · 0.80

Tested by

no test coverage detected