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

Function test_robots_node_scrapable

tests/nodes/robot_node_test.py:25–38  ·  view source on GitHub ↗
(robots_node)

Source from the content-addressed store, hash-verified

23
24
25def test_robots_node_scrapable(robots_node):
26 state = {"url": "https://perinim.github.io/robots.txt"}
27
28 # Mocking AsyncChromiumLoader to return a fake robots.txt content
29 robots_node.AsyncChromiumLoader = MagicMock(
30 return_value=MagicMock(load=MagicMock(return_value="User-agent: *\nAllow: /"))
31 )
32
33 # Execute the node
34 result_state, result = robots_node.execute(state)
35
36 # Check the updated state
37 assert result_state["is_scrapable"] == "yes"
38 assert result == ("is_scrapable", "yes")
39
40
41def test_robots_node_not_scrapable(robots_node):

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected