File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def __init__(self, api: API):
2222 def fetch (
2323 self ,
2424 node_dcids : str | list [str ],
25- expression : str | list [ str ] ,
25+ expression : str ,
2626 * ,
2727 all_pages : bool = True ,
2828 next_token : Optional [str ] = None ,
@@ -31,7 +31,7 @@ def fetch(
3131
3232 Args:
3333 node_dcids (str | List[str]): The DCID(s) of the nodes to query.
34- expression (str | List[str] ): The property or relation expression(s) to query.
34+ expression (str): The property or relation expression(s) to query.
3535 all_pages: If True, fetch all pages of the response. If False, fetch only the first page.
3636 Defaults to True. Set to False to only fetch the first page. In that case, a
3737 `next_token` key in the response will indicate if more pages are available.
Original file line number Diff line number Diff line change @@ -41,34 +41,6 @@ def test_node_endpoint_fetch():
4141 assert "test_node" in response .data
4242
4343
44- def test_node_endpoint_fetch_list_input ():
45- """Test the fetch method with list inputs for node_dcids and expression."""
46- api_mock = MagicMock (spec = API )
47- api_mock .post .return_value = {
48- "data" : {
49- "test_node" : {
50- "properties" : {
51- "name" : "Test"
52- }
53- }
54- }
55- }
56-
57- endpoint = NodeEndpoint (api = api_mock )
58- response = endpoint .fetch (node_dcids = ["test_node1" , "test_node2" ],
59- expression = ["name" , "typeOf" ])
60-
61- api_mock .post .assert_called_once_with (payload = {
62- "nodes" : ["test_node1" , "test_node2" ],
63- "property" : "[name, typeOf]" ,
64- },
65- endpoint = "node" ,
66- all_pages = True ,
67- next_token = None )
68- assert isinstance (response , NodeResponse )
69- assert "test_node" in response .data
70-
71-
7244def test_node_endpoint_fetch_property_labels ():
7345 """Test fetch_property_labels method."""
7446 api_mock = MagicMock (spec = API )
You can’t perform that action at this time.
0 commit comments