#NEWLINE# def configure_cache( client , test_name ) : #NEWLINE# #INDENT# "Loads or begins a cached session to record HTTP traffic.\n\n  Should be called at the beginning of each test method.\n\n  Args:\n    client: a gdata.GDClient whose http_client member has been replaced\n            with a atom.mock_http_core.MockHttpClient so that repeated\n            executions can used cached responses instead of contacting\n            the server.\n    test_name: str The name of this test method. Examples: \n               'TestClass.test_x_works', 'TestClass.test_crud_operations'.\n               This is used to name the recording of the HTTP requests and\n               responses, so it should be unique to each test method in the\n               test case.\n  " #NEWLINE# client . http_client . cache_test_name = test_name #NEWLINE# cache_name = client . http_client . get_cache_file_name ( ) #NEWLINE# if ( options . get_value ( 'clearcache' ) == 'true' ) : #NEWLINE# #INDENT# client . http_client . delete_session ( cache_name ) #NEWLINE# #UNINDENT# client . http_client . use_cached_session ( test_name )