This commit is contained in:
sheldy 2023-05-25 21:42:07 +03:00
parent 66631181af
commit 435f4f8b77
2 changed files with 17 additions and 0 deletions

View file

@ -189,6 +189,20 @@ class TestSimpleRequestHandler:
result = await resp.json()
assert not result
async def test_verify_secret(self, bot: MockedBot, aiohttp_client):
app = Application()
dp = Dispatcher()
handler = SimpleRequestHandler(
dispatcher=dp,
bot=bot,
handle_in_background=False,
secret_token="vasya228"
)
handler.register(app, path="/webhook")
client: TestClient = await aiohttp_client(app)
resp = await self.make_reqest(client=client)
assert resp.status == 401
class TestTokenBasedRequestHandler:
async def test_register(self):