From 996b88c5614819f448e1f8d0163d0c1a6f6425f3 Mon Sep 17 00:00:00 2001 From: Kristoffer Andersson Date: Tue, 3 May 2022 08:03:13 +0200 Subject: [PATCH] test: impl adapter --- karp/tests/unit/lex/adapters.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/karp/tests/unit/lex/adapters.py b/karp/tests/unit/lex/adapters.py index 1b9aed6b..902fff26 100644 --- a/karp/tests/unit/lex/adapters.py +++ b/karp/tests/unit/lex/adapters.py @@ -68,8 +68,14 @@ class InMemoryReadResourceRepository(ReadOnlyResourceRepository): def __init__(self, resources: Dict): self.resources = resources - def get_by_resource_id( - self, resource_id: str, version=None + def get_by_id(self, entity_id: UniqueId, version: Optional[int] = None) -> Optional[ResourceDto]: + resource = self.resources.get(entity_id) + if resource: + return self._row_to_dto(resource) + return None + + def _get_by_resource_id( + self, resource_id: str ) -> Optional[ResourceDto]: return next( (