feat(rp5): add rp5 api
This commit is contained in:
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
from typing import TypeVar
|
||||
|
||||
from gallery.sketch.api import Api, S
|
||||
from gallery.sketch.source import DEFAULT_REQUEST_MODE, ApiSource, RequestMode
|
||||
from gallery.sketch.source import ApiSource
|
||||
|
||||
|
||||
class MockSource(ApiSource):
|
||||
@@ -12,7 +12,7 @@ class MockSource(ApiSource):
|
||||
self._path = path
|
||||
self._mapping = mapping
|
||||
|
||||
async def request(self, endpoint: str, /, mode: RequestMode = DEFAULT_REQUEST_MODE) -> str:
|
||||
async def request(self, endpoint: str, /, **kwargs) -> str:
|
||||
for pattern, filename in self._mapping.items():
|
||||
if pattern in endpoint:
|
||||
return (self._path / filename).read_text()
|
||||
|
||||
Reference in New Issue
Block a user