chapps.tests.test_sqla_adapter.test_sqla_adapter module

Tests of CHAPPS SQLAlchemy adapters module

class chapps.tests.test_sqla_adapter.test_sqla_adapter.Test_SQLAPolicyConfigAdapter[source]

Bases: object

test_install_schema(database_fixture, sqla_pc_adapter_fixture)[source]
class chapps.tests.test_sqla_adapter.test_sqla_adapter.Test_SQLAQuotaAdapter[source]

Bases: object

test_initialize_tables_default(sqla_oqp_adapter_fixture, database_fixture)[source]

Verify that MDBQA’s table initialization works properly

test_quota_for_user(populated_database_fixture, sqla_oqp_adapter_fixture)[source]

Verify that MDBQA.quota_for_user returns the expected quota for an email

test_quota_for_nonexistent_user(populated_database_fixture, sqla_oqp_adapter_fixture)[source]

Verify that MDBQA.quota_for_user returns None when the email is not found in the database.

class chapps.tests.test_sqla_adapter.test_sqla_adapter.Test_SQLASenderDomainAuthAdapter[source]

Bases: object

test_initialize_tables(sqla_sda_adapter_fixture, database_fixture)[source]

Verify that MDBSDAA’s table initialization works properly

test_check_domain_for_user(sqla_sda_adapter_fixture, populated_database_fixture)[source]

GIVEN a user has an entry in the database WHEN that user tries to send an email for a domain they are linked to THEN return a True result

test_check_email_for_user(sqla_sda_adapter_fixture, populated_database_fixture)[source]
test_check_domain_for_unauth_user(sqla_sda_adapter_fixture, populated_database_fixture)[source]

GIVEN a user has an entry in the database WHEN that user tries to send an email for a domain they are not linked to THEN return a False result

test_check_domain_for_nonexistent_user(sqla_sda_adapter_fixture, populated_database_fixture)[source]

GIVEN a user has no entry in the database WHEN that user tries to send an email for any domain THEN return a False result

class chapps.tests.test_sqla_adapter.test_sqla_adapter.Test_SQLAInboundFlagsAdapter[source]

Bases: object

test_greylisting_flag_set(sqla_if_adapter_fixture, populated_database_fixture_with_extras, greylisting_domain)[source]
GIVEN

a domain has the greylisting option set

WHEN

asked whether the domain enforces greylisting

THEN

the adapter should return True

test_greylisting_flag_unset(sqla_if_adapter_fixture, populated_database_fixture_with_extras, no_options_domain)[source]
GIVEN

a domain does not have greylisting enabled

WHEN

asked whether the domain enforces greylisting

THEN

the adapter should return False

test_check_spf_flag_set(sqla_if_adapter_fixture, populated_database_fixture_with_extras, spf_domain)[source]
GIVEN

a domain has SPF checking enabled

WHEN

asked whether the domain enforces SPF policies

THEN

the adapter should return True

test_check_spf_flag_unset(sqla_if_adapter_fixture, populated_database_fixture_with_extras, no_options_domain)[source]
GIVEN

a domain does not have SPF checking enabled

WHEN

asked whether a domain enforces SPF policies

THEN

the adapter should return False