#NEWLINE# def test_caches_previously_loaded_clients( self ) : #NEWLINE# #INDENT# session = Mock ( ) #NEWLINE# s3_client = Mock ( ) #NEWLINE# session . create_client . return_value = s3_client #NEWLINE# s3_client . get_bucket_location . return_value = { #NEWLINE# #INDENT# 'LocationConstraint' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# provider = S3ClientProvider ( session ) #NEWLINE# client = provider . get_client ( 'foo' ) #NEWLINE# self . assertEqual ( 1 , s3_client . create_client . call_count ) #NEWLINE# self . assertEqual ( client , provider . get_client ( 'foo' ) ) #NEWLINE# self . assertEqual ( 1 , session . create_client . call_count )