Skip to content

mock

Classes:

  • MockSession

    A variant of Session which stores sent messages in memory and is intended for use in test

Attributes:

LOG module-attribute

LOG = getLogger()

MockSession

MockSession()

Bases: BaseSession

A variant of Session which stores sent messages in memory and is intended for use in test suites.

Attributes:

Methods:

messages instance-attribute

messages = []

send_email

send_email(message)

assert_message_sent

assert_message_sent(message)

Assert that a message which compares equal to the passed message was sent.

sent_message_from_id

sent_message_from_id(message_id)

Query a sent message by message id.

Returns:

Raises:

  • KeyError

    no matching message was found.