def gen_all_identities():
 def _build_identity_dict(mail, display_name, given_name, surname):
  ' Helper function to return a dict of test identity '
  meta_dict = {'Shib-Identity-Provider': IDP, 'REMOTE_USER': REMOTE_USER}
  if (display_name is not None):
   meta_dict['displayName'] = display_name
  if (mail is not None):
   meta_dict['mail'] = mail
  if (given_name is not None):
   meta_dict['givenName'] = given_name
  if (surname is not None):
   meta_dict['sn'] = surname
  return meta_dict
 for mail in MAILS:
  for given_name in GIVENNAMES:
   for surname in SNS:
    for display_name in DISPLAYNAMES:
     (yield _build_identity_dict(mail, display_name, given_name, surname))

def gen_all_identities ( ) : def _build_identity_dict ( mail , display_name , given_name , surname ) : meta_dict = { 'Shib-Identity-Provider' : IDP , 'REMOTE_USER' : REMOTE_USER } if ( display_name is not None ) : meta_dict [ 'displayName' ] = display_name if ( mail is not None ) : meta_dict [ 'mail' ] = mail if ( given_name is not None ) : meta_dict [ 'givenName' ] = given_name if ( surname is not None ) : meta_dict [ 'sn' ] = surname return meta_dict for mail in MAILS : for given_name in GIVENNAMES : for surname in SNS : for display_name in DISPLAYNAMES : ( yield _build_identity_dict ( mail , display_name , given_name , surname ) )
a generator for all combinations of test inputs .