Package openid :: Package test :: Module test_association_response
[hide private]
[frames] | no frames]

Module test_association_response

source code

Tests for consumer handling of association responses

This duplicates some things that are covered by test_consumer, but this works for now.

Classes [hide private]
  BaseAssocTest
  TestExtractAssociationMissingFieldsOpenID2
Test for returning an error upon missing fields in association responses for OpenID 2
  TestExtractAssociationMissingFieldsOpenID1
Test for returning an error upon missing fields in association responses for OpenID 2
  DummyAssocationSession
  ExtractAssociationSessionTypeMismatch
  TestOpenID1AssociationResponseSessionType
  DummyAssociationSession
  TestInvalidFields
  TestExtractAssociationDiffieHellman
Functions [hide private]
 
mkAssocResponse(*keys)
Build an association response message that contains the specified subset of keys.
source code
 
mkExtractAssocMissingTest(keys)
Factory function for creating test methods for generating missing field tests.
source code
Variables [hide private]
  association_response_values = {'expires_in': '1000', 'assoc_ha...
Function Details [hide private]

mkAssocResponse(*keys)

source code 

Build an association response message that contains the specified subset of keys. The values come from `association_response_values`.

This is useful for testing for missing keys and other times that we don't care what the values are.

mkExtractAssocMissingTest(keys)

source code 
Factory function for creating test methods for generating
missing field tests.

Make a test that ensures that an association response that
is missing required fields will short-circuit return None.

According to 'Association Session Response' subsection 'Common
Response Parameters', the following fields are required for OpenID
2.0:

 * ns
 * session_type
 * assoc_handle
 * assoc_type
 * expires_in

If 'ns' is missing, it will fall back to OpenID 1 checking. In
OpenID 1, everything except 'session_type' and 'ns' are required.


Variables Details [hide private]

association_response_values

Value:
{'expires_in': '1000', 'assoc_handle': 'a handle', 'assoc_type': 'a ty\
pe', 'session_type': 'a session type', 'ns': OPENID2_NS,}