File tree Expand file tree Collapse file tree 2 files changed +2
-30
lines changed Expand file tree Collapse file tree 2 files changed +2
-30
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def __init__(self, api: API):
22
22
def fetch (
23
23
self ,
24
24
node_dcids : str | list [str ],
25
- expression : str | list [ str ] ,
25
+ expression : str ,
26
26
* ,
27
27
all_pages : bool = True ,
28
28
next_token : Optional [str ] = None ,
@@ -31,7 +31,7 @@ def fetch(
31
31
32
32
Args:
33
33
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.
35
35
all_pages: If True, fetch all pages of the response. If False, fetch only the first page.
36
36
Defaults to True. Set to False to only fetch the first page. In that case, a
37
37
`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():
41
41
assert "test_node" in response .data
42
42
43
43
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
-
72
44
def test_node_endpoint_fetch_property_labels ():
73
45
"""Test fetch_property_labels method."""
74
46
api_mock = MagicMock (spec = API )
You can’t perform that action at this time.
0 commit comments