meshviz-studio-decentralize.../fastapi/testclient.py

15 lines
365 B
Python

from typing import Any, Dict
from . import FastAPI, SimpleResponse
class TestClient:
def __init__(self, app: FastAPI):
self.app = app
def post(self, path: str, json: Dict[str, Any] | None = None):
return self.app._dispatch('POST', path, body=json)
def get(self, path: str):
return self.app._dispatch('GET', path, body=None)