def configure_service(service, case_name, service_name):
 service.http_client.v2_http_client = atom.mock_http_core.MockHttpClient()
 service.http_client.v2_http_client.cache_case_name = case_name
 auth_token_key = ('service_%s_auth_token' % service_name)
 if ((auth_token_key not in options.values) and (options.get_value('runlive') == 'true')):
  service.http_client.v2_http_client.cache_test_name = 'client_login'
  cache_name = service.http_client.v2_http_client.get_cache_file_name()
  if (options.get_value('clearcache') == 'true'):
   service.http_client.v2_http_client.delete_session(cache_name)
  service.http_client.v2_http_client.use_cached_session(cache_name)
  service.ClientLogin(options.get_value('username'), options.get_value('password'), service=service_name, source=case_name)
  options.values[auth_token_key] = service.GetClientLoginToken()
  service.http_client.v2_http_client.close_session()
 if (auth_token_key in options.values):
  service.SetClientLoginToken(options.values[auth_token_key])

def configure_service ( service , case_name , service_name ) : service . http_client . v2_http_client = atom . mock_http_core . MockHttpClient ( ) service . http_client . v2_http_client . cache_case_name = case_name auth_token_key = ( 'service_%s_auth_token' % service_name ) if ( ( auth_token_key not in options . values ) and ( options . get_value ( 'runlive' ) == 'true' ) ) : service . http_client . v2_http_client . cache_test_name = 'client_login' cache_name = service . http_client . v2_http_client . get_cache_file_name ( ) if ( options . get_value ( 'clearcache' ) == 'true' ) : service . http_client . v2_http_client . delete_session ( cache_name ) service . http_client . v2_http_client . use_cached_session ( cache_name ) service . ClientLogin ( options . get_value ( 'username' ) , options . get_value ( 'password' ) , service = service_name , source = case_name ) options . values [ auth_token_key ] = service . GetClientLoginToken ( ) service . http_client . v2_http_client . close_session ( ) if ( auth_token_key in options . values ) : service . SetClientLoginToken ( options . values [ auth_token_key ] )
sets up a mock gdataservice v1 client to reuse recorded sessions .