Skip to content

Commit

Permalink
add typeadapter
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Oct 8, 2024
1 parent b29329a commit 3cb4ea5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/datcore-adapter/tests/unit/test_route_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import httpx
import respx
from fastapi_pagination import Page
from pydantic import parse_obj_as
from pydantic import TypeAdapter
from simcore_service_datcore_adapter.models.schemas.datasets import (
DatasetMetaData,
FileMetaData,
Expand All @@ -29,7 +29,7 @@ async def test_list_datasets_entrypoint(
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data
parse_obj_as(Page[DatasetMetaData], data)
TypeAdapter(Page[DatasetMetaData]).validate_python(data)


async def test_list_dataset_files_legacy_entrypoint(
Expand All @@ -47,7 +47,7 @@ async def test_list_dataset_files_legacy_entrypoint(
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data
parse_obj_as(list[FileMetaData], data)
TypeAdapter(list[FileMetaData]).validate_python(data)


async def test_list_dataset_top_level_files_entrypoint(
Expand All @@ -65,7 +65,7 @@ async def test_list_dataset_top_level_files_entrypoint(
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data
parse_obj_as(Page[FileMetaData], data)
TypeAdapter(Page[FileMetaData]).validate_python(data)


async def test_list_dataset_collection_files_entrypoint(
Expand All @@ -85,4 +85,4 @@ async def test_list_dataset_collection_files_entrypoint(
assert response.status_code == status.HTTP_200_OK
data = response.json()
assert data
parse_obj_as(Page[FileMetaData], data)
TypeAdapter(Page[FileMetaData]).validate_python(data)

0 comments on commit 3cb4ea5

Please sign in to comment.