chapps.tests.test_util.test_util module

CHAPPS Utilities Tests

class chapps.tests.test_util.test_util.Test_AttrDict[source]

Bases: object

test_attr_dict_return_int(mock_config_dict)[source]
test_attr_dict_return_float(mock_config_dict)[source]
test_attr_dict_return_string(mock_config_dict)[source]
test_return_boolean(mock_config_dict)[source]
test_contains(mock_config_dict)[source]
test_len(mock_config_dict)[source]
test_getitem(mock_config_dict)[source]
test_keys(mock_config_dict)[source]
class chapps.tests.test_util.test_util.Test_PostfixPolicyRequest[source]

Bases: object

test_instantiate_ppr(postfix_policy_request_message)[source]
GIVEN

a policy data payload from Postfix

WHEN

a new ppr object is instantiated from it

THEN

a new ppr object should be returned containing a copy of that data

test_attribute(postfix_policy_request_message)[source]
GIVEN

a ppr object with contents

WHEN

an attribute is requested

THEN

its value (from the payload) should be returned

test_dereference(postfix_policy_request_message)[source]
GIVEN

a ppr object with contents

WHEN

an attribute is dereferenced

THEN

its value (from the payload) should be returned

test_iterable(postfix_policy_request_message)[source]
GIVEN

a ppr object with contents

WHEN

an iterable is requested (as with items())

THEN

a dict-iterator should be returned, containing the payload data

test_len(postfix_policy_request_message)[source]
GIVEN

a ppr object with contents

WHEN

asked for length

THEN

the number of parameters from the payload should be returned

NB

(the payload ends with an extra blank line)

test_recipients(postfix_policy_request_message)[source]
GIVEN

a PPR w/ more than one recipient listed

WHEN

the pseudo-attribute recipients is accessed

THEN

a list should be returned with one element per recipient

test_helo_match(postfix_policy_request_message)[source]
GIVEN

a PPR w/ particular HELO name and IP

WHEN

asked to match against a name->IP map of candidates

THEN

return True if the HELO name is in the map and the IP matches