add test cases

This commit is contained in:
yanyongyu
2021-12-20 00:28:02 +08:00
parent ca045b2f73
commit c2c3d5ef4b
17 changed files with 432 additions and 55 deletions

View File

@ -10,10 +10,14 @@ import asyncio
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Set, Dict, Type, Callable, Awaitable
from ._model import URL as URL
from nonebot.log import logger
from nonebot.utils import escape_tag
from ._model import Request as Request
from nonebot.config import Env, Config
from ._model import URL, Request, Response, WebSocket, HTTPVersion
from ._model import Response as Response
from ._model import WebSocket as WebSocket
from ._model import HTTPVersion as HTTPVersion
from nonebot.typing import T_BotConnectionHook, T_BotDisconnectionHook
if TYPE_CHECKING:
@ -204,11 +208,11 @@ class ForwardDriver(Driver):
"""
@abc.abstractmethod
async def request(self, setup: "Request") -> Any:
async def request(self, setup: Request) -> Response:
raise NotImplementedError
@abc.abstractmethod
async def websocket(self, setup: "Request") -> Any:
async def websocket(self, setup: Request) -> WebSocket:
raise NotImplementedError