thunderbird_accounts.telemetry.tests

Classes

CapturePrivacyTestCase([methodName])

Tests that enforce privacy contracts: PII must never reach PostHog.

GetClientTestCase([methodName])

SubmitEventTimestampTestCase([methodName])

submit_event must hand PostHog a real datetime; the SDK silently drops string timestamps.

class thunderbird_accounts.telemetry.tests.GetClientTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_returns_singleton(mock_posthog_class)

Multiple calls return the same instance without re-initializing.

class thunderbird_accounts.telemetry.tests.CapturePrivacyTestCase(methodName='runTest')[source]

Bases: TestCase

Tests that enforce privacy contracts: PII must never reach PostHog.

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_noop_when_not_configured()

Must not raise when PostHog is unconfigured.

test_empty_user_id_is_dropped(mock_posthog_class)

Events with no keycloak_user_id must not be submitted.

class thunderbird_accounts.telemetry.tests.SubmitEventTimestampTestCase(methodName='runTest')[source]

Bases: TestCase

submit_event must hand PostHog a real datetime; the SDK silently drops string timestamps.

setUp()[source]

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

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.