MockSlackWebhook

class safir.testing.slack.MockSlackWebhook(url)

Bases: object

Represents a Slack incoming webhook and remembers what was posted.

messages

Messages that have been posted to the webhook so far.

url

URL that the mock has been configured to listen on.

Parameters:

url (str)

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:

httpx.Response