Package openid :: Package test :: Module test_association_response
[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
  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
 
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
  association_response_values = {'assoc_handle': 'a handle', 'as...
Function Details

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

association_response_values

Value:
{'assoc_handle': 'a handle',
 'assoc_type': 'a type',
 'expires_in': '1000',
 'ns': 'http://specs.openid.net/auth/2.0',
 'session_type': 'a session type'}