def _TestAuthViewfinderUser(action, tester, user_dict, device_dict=None, user_cookie=None):
 if ('email' in user_dict):
  ident_dict = {'key': ('Email:%s' % user_dict['email']), 'authority': 'Viewfinder'}
 else:
  ident_dict = {'key': ('Phone:%s' % user_dict['phone']), 'authority': 'Viewfinder'}
 response = _AuthViewfinderUser(tester, action, user_dict, ident_dict, device_dict, user_cookie)
 cookie_user_dict = tester.DecodeUserCookie(tester.GetCookieFromResponse(response))
 if ((action != 'link') and (not ((action == 'login') and ('password' in user_dict)))):
  assert ('confirm_time' in cookie_user_dict), cookie_user_dict
 else:
  assert ('confirm_time' not in cookie_user_dict), cookie_user_dict
 return auth_test._ValidateAuthUser(tester, action, user_dict, ident_dict, device_dict, user_cookie, response)

def _TestAuthViewfinderUser ( action , tester , user_dict , device_dict = None , user_cookie = None ) : if ( 'email' in user_dict ) : ident_dict = { 'key' : ( 'Email:%s' % user_dict [ 'email' ] ) , 'authority' : 'Viewfinder' } else : ident_dict = { 'key' : ( 'Phone:%s' % user_dict [ 'phone' ] ) , 'authority' : 'Viewfinder' } response = _AuthViewfinderUser ( tester , action , user_dict , ident_dict , device_dict , user_cookie ) cookie_user_dict = tester . DecodeUserCookie ( tester . GetCookieFromResponse ( response ) ) if ( ( action != 'link' ) and ( not ( ( action == 'login' ) and ( 'password' in user_dict ) ) ) ) : assert ( 'confirm_time' in cookie_user_dict ) , cookie_user_dict else : assert ( 'confirm_time' not in cookie_user_dict ) , cookie_user_dict return auth_test . _ValidateAuthUser ( tester , action , user_dict , ident_dict , device_dict , user_cookie , response )
called by the servicetester in order to test login/viewfinder .