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
  # Getting the auth token only needs to be done once in the course of test
  # runs.
  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.
dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/gdata/test_config.py/configure_service