MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / DummyBaseGraph

Class DummyBaseGraph

tests/test_csv_scraper_multi_graph.py:31–55  ·  view source on GitHub ↗

Dummy BaseGraph to test _create_graph method without side effects.

Source from the content-addressed store, hash-verified

29
30
31class DummyBaseGraph:
32 """Dummy BaseGraph to test _create_graph method without side effects."""
33
34 def __init__(self, nodes, edges, entry_point, graph_name):
35 self.nodes = nodes
36 self.edges = edges
37 self.entry_point = entry_point
38 self.graph_name = graph_name
39
40 config = {
41 "llm": {"model": "dummy_model", "model_provider": "dummy_provider"},
42 "key": "value",
43 }
44 """Test that CSVScraperMultiGraph.run returns the expected answer when provided by the graph."""
45 prompt = "Test prompt"
46 source = ["url1", "url2"]
47
48 # Instantiate the graph
49 multi_graph = CSVScraperMultiGraph(prompt, source, config)
50
51 # Override the graph attribute with a dummy graph returning an expected answer
52 multi_graph.graph = DummyGraph("expected answer")
53
54 result = multi_graph.run()
55 assert result == "expected answer"
56
57
58def test_run_no_answer():

Callers 1

Calls 3

DummyGraphClass · 0.70
runMethod · 0.45

Tested by 1