"""Tests for the API utilities.""" from oto import status from oto.response import Response import pytest from collaborator.constants import api as api_constants from collaborator.utils import api @pytest.mark.parametrize( "items, total_records, status", [([1, 2, 3], 42, status.OK), ([1], 1, status.CREATED)], ) def test_create_paginated_response(items, total_records, status): """Test creating a paginated response.""" result = api.create_paginated_response(items, total_records, status) assert type(result) is Response assert result.status == status assert result.message == { "items": items, "pagination": { "type": api_constants.PAGINATION_TYPE_STANDARD, "total_records": total_records, }, }