@@ -52,8 +52,8 @@ def test_fetch_dcid_by_wikidata_id():
5252 api_mock = MagicMock (spec = API )
5353 endpoint = ResolveEndpoint (api = api_mock )
5454
55- response = endpoint .fetch_dcid_by_wikidata_id ( wikidata_id = "Q12345" ,
56- entity_type = "Country" )
55+ response = endpoint .fetch_dcids_by_wikidata_id ( wikidata_ids = "Q12345" ,
56+ entity_type = "Country" )
5757
5858 # Check the response
5959 assert isinstance (response , ResolveResponse )
@@ -68,6 +68,27 @@ def test_fetch_dcid_by_wikidata_id():
6868 next_token = None )
6969
7070
71+ def test_fetch_dcids_list_by_wikidata_id ():
72+ """Tests the fetch_dcid_by_wikidata_id method."""
73+ api_mock = MagicMock (spec = API )
74+ endpoint = ResolveEndpoint (api = api_mock )
75+
76+ response = endpoint .fetch_dcids_by_wikidata_id (
77+ wikidata_ids = ["Q12345" , "Q695660" ])
78+
79+ # Check the response
80+ assert isinstance (response , ResolveResponse )
81+
82+ # Check the post request
83+ api_mock .post .assert_called_once_with (payload = {
84+ "nodes" : ["Q12345" , "Q695660" ],
85+ "property" : "<-wikidataId->dcid" ,
86+ },
87+ endpoint = "resolve" ,
88+ all_pages = True ,
89+ next_token = None )
90+
91+
7192def test_fetch_dcid_by_coordinates ():
7293 """Tests the fetch_dcid_by_coordinates method."""
7394 api_mock = MagicMock (spec = API )
0 commit comments