thunderbird_accounts.mail.tests.test_clients.test_jmap

Functions

build_admin_client()

Build a MailClientAdminJMAP that never touches the network.

build_user_client()

v016_dkim_signature(*[, stage])

Classes

AliasJMapContract([account_aliases, ...])

MockJMapClient(base_url, username, token[, ...])

TestAccountOperations([methodName])

TestCheckDomainDNS([methodName])

TestCreateDkim([methodName])

TestDeleteDkim([methodName])

TestDeleteDomain([methodName])

TestDkimLifecycle([methodName])

TestEmailAddressUpdates([methodName])

TestGetDkimSignatures([methodName])

TestJMAPClientTransport([methodName])

TestOriginMismatchIsRecoverable([methodName])

The origin mismatch must be catchable by the handlers that already degrade gracefully.

TestProductionInterfaceParity([methodName])

TestUserAppPasswords([methodName])

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestJMAPClientTransport(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_non_json_method_body_raises_client_error(request_mock: MagicMock)

Covers the empty body of a 307/308 too: request() does not follow redirects.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.MockJMapClient(base_url: str, username: str, token: str, auth_type: AUTH_TYPES = AUTH_TYPES.BEARER, verify_ssl: bool | str = True, timeout: float | tuple[float, float] = 30)[source]

Bases: JMAPClient

get_session() → SessionResource[source]

Return the JMAP Session Resource as a Python dict

request(request_data: JMapRequest, method: Literal['get', 'post'] = 'post') → JMapResponse[source]

Make a JMAP POST request to the API, returning the response as a Python data structure.

thunderbird_accounts.mail.tests.test_clients.test_jmap.build_admin_client() → MailClientAdminJMAP[source]

Build a MailClientAdminJMAP that never touches the network.

MailClientAdminJMAP.__init__ builds a real JMAPClient and eagerly fetches the session resource over HTTP, so patch _get_user_client for the duration of construction to hand back a MockJMapClient (which reads the session from a fixture) instead.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestUserAppPasswords(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestEmailAddressUpdates(methodName='runTest')[source]

Bases: SimpleTestCase

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestAccountOperations(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestCheckDomainDNS(methodName='runTest')[source]

Bases: TestMailClientCheckDomainDNS

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestCreateDkim(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestGetDkimSignatures(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestDeleteDkim(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestDeleteDomain(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestDkimLifecycle(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestProductionInterfaceParity(methodName='runTest')[source]

Bases: SimpleTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

class thunderbird_accounts.mail.tests.test_clients.test_jmap.TestOriginMismatchIsRecoverable(methodName='runTest')[source]

Bases: SimpleTestCase

The origin mismatch must be catchable by the handlers that already degrade gracefully.

It is the one new failure guaranteed to fire against a Stalwart whose advertised apiUrl has not been corrected, so it must not be the one failure that escapes as a 500.