chapps.tests.test_util.test_util module
CHAPPS Utilities Tests
- 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)