@@ -391,19 +391,19 @@ async def test_get_collections_search_limit_offset(
391391 prev_link = list (filter (lambda link : link ["rel" ] == "previous" , links ))[0 ]
392392 assert prev_link ["href" ].endswith ("?limit=1&offset=2" )
393393
394- # # ##################
395- # # offset=3,limit=2
396- # resp = await app_client.get(
397- # "/collections",
398- # params={"limit": 2,"offset": 3},
399- # )
400- # cols = resp.json()["collections"]
401- # links = resp.json()["links"]
402- # assert len(cols) == 0
403- # assert len(links) == 3
404- # assert {"root", "self", "previous"} == {link["rel"] for link in links}
405- # prev_link = list(filter(lambda link: link["rel"] == "previous", links))[0]
406- # assert prev_link["href"].endswith("?limit=1 &offset=2 ")
394+ ###################
395+ # limit=2, offset=3, there should not be a next link
396+ resp = await app_client .get (
397+ "/collections" ,
398+ params = {"limit" : 2 , "offset" : 3 },
399+ )
400+ cols = resp .json ()["collections" ]
401+ links = resp .json ()["links" ]
402+ assert len (cols ) == 0
403+ assert len (links ) == 3
404+ assert {"root" , "self" , "previous" } == {link ["rel" ] for link in links }
405+ prev_link = list (filter (lambda link : link ["rel" ] == "previous" , links ))[0 ]
406+ assert prev_link ["href" ].endswith ("?limit=2 &offset=1 " )
407407
408408 ###################
409409 # offset=1, should have a `previous` link
0 commit comments