def _TestListIdentities(tester, user_cookie, request_dict):
 validator = tester.validator
 (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
 request_dict = deepcopy(request_dict)
 actual_dict = tester.SendRequest('list_identities', user_cookie, request_dict)
 expected_dict = {'user_identities': []}
 predicate = (lambda ident: (ident.user_id == user_id))
 for expected_ident in validator.QueryModelObjects(Identity, predicate=predicate):
  ident_dict = {'identity': expected_ident.key}
  if (expected_ident.authority is not None):
   ident_dict['authority'] = expected_ident.authority
  expected_dict['user_identities'].append(ident_dict)
 tester._CompareResponseDicts('list_identities', user_id, request_dict, expected_dict, actual_dict)
 return actual_dict

def _TestListIdentities ( tester , user_cookie , request_dict ) : validator = tester . validator ( user_id , device_id ) = tester . GetIdsFromCookie ( user_cookie ) request_dict = deepcopy ( request_dict ) actual_dict = tester . SendRequest ( 'list_identities' , user_cookie , request_dict ) expected_dict = { 'user_identities' : [ ] } predicate = ( lambda ident : ( ident . user_id == user_id ) ) for expected_ident in validator . QueryModelObjects ( Identity , predicate = predicate ) : ident_dict = { 'identity' : expected_ident . key } if ( expected_ident . authority is not None ) : ident_dict [ 'authority' ] = expected_ident . authority expected_dict [ 'user_identities' ] . append ( ident_dict ) tester . _CompareResponseDicts ( 'list_identities' , user_id , request_dict , expected_dict , actual_dict ) return actual_dict
called by the servicetester in order to test list_identities service api call .