File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from types import MappingProxyType
2+
3+ from hyperbrowser .models .scrape import StartScrapeJobParams
4+ from hyperbrowser .tools import WebsiteScrapeTool
5+
6+
7+ class _Response :
8+ def __init__ (self , data ):
9+ self .data = data
10+
11+
12+ class _ScrapeManager :
13+ def __init__ (self ):
14+ self .last_params = None
15+
16+ def start_and_wait (self , params : StartScrapeJobParams ):
17+ self .last_params = params
18+ return _Response (type ("Data" , (), {"markdown" : "ok" })())
19+
20+
21+ class _Client :
22+ def __init__ (self ):
23+ self .scrape = _ScrapeManager ()
24+
25+
26+ def test_tool_wrappers_accept_mapping_inputs ():
27+ client = _Client ()
28+ params = MappingProxyType ({"url" : "https://example.com" })
29+
30+ output = WebsiteScrapeTool .runnable (client , params )
31+
32+ assert output == "ok"
33+ assert isinstance (client .scrape .last_params , StartScrapeJobParams )
You can’t perform that action at this time.
0 commit comments