diff --git a/tests/_async/test_filter_request_builder_integration.py b/tests/_async/test_filter_request_builder_integration.py index 11e8ae1..26d5260 100644 --- a/tests/_async/test_filter_request_builder_integration.py +++ b/tests/_async/test_filter_request_builder_integration.py @@ -483,6 +483,48 @@ async def test_rpc_with_range(): ] +async def test_rpc_post_with_args(): + res = ( + await rest_client() + .rpc("search_countries_by_name", {"search_name": "Alban"}) + .select("nicename, iso") + .execute() + ) + assert res.data == [{"nicename": "Albania", "iso": "AL"}] + + +async def test_rpc_get_with_args(): + res = ( + await rest_client() + .rpc("search_countries_by_name", {"search_name": "Alger"}, get=True) + .select("nicename, iso") + .execute() + ) + assert res.data == [{"nicename": "Algeria", "iso": "DZ"}] + + +async def test_rpc_get_with_count(): + res = ( + await rest_client() + .rpc("search_countries_by_name", {"search_name": "Al"}, get=True, count="exact") + .select("nicename") + .execute() + ) + assert res.count == 2 + assert res.data == [{"nicename": "Albania"}, {"nicename": "Algeria"}] + + +async def test_rpc_head_count(): + res = ( + await rest_client() + .rpc("search_countries_by_name", {"search_name": "Al"}, head=True, count="exact") + .execute() + ) + + assert res.count == 2 + assert res.data == [] + + async def test_order(): res = ( await rest_client()