MockSlackWebhook#
- class safir.testing.slack.MockSlackWebhook(url)#
Bases:
objectRepresents a Slack incoming webhook and remembers what was posted.
- Parameters:
url (
str) – URL that the mock has been configured to listen on.
- url#
URL that the mock has been configured to listen on.
Methods Summary
post_webhook(request)Post a Slack message.
Methods Documentation
- post_webhook(request)#
Post a Slack message.
The provided message is stored in the messages attribute.
- Parameters:
request (
Request) – Incoming request.- Returns:
Always returns a 201 response.
- Return type:
Response
Notes
For now, this returns an
httpx.Responseinstead of using HTTPX2 since respx still expects that return value from side effect mocks.