Skip to content

Commit

Permalink
test: impl adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed May 3, 2022
1 parent 4dce02f commit 996b88c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions karp/tests/unit/lex/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
Expand Down

0 comments on commit 996b88c

Please sign in to comment.