#NEWLINE# @ mock . patch ( 'cloudbaseinit.metadata.services.maasservice.MaaSHttpService._get_cache_data' ) #NEWLINE# def test_get_client_auth_certs( self , mock_get_cache_data ) : #NEWLINE# #INDENT# certs = [ '{begin}\n{cert}\n{end}' . format ( begin = x509constants . PEM_HEADER , end = x509constants . PEM_FOOTER , cert = cert ) for cert in ( 'first cert' , 'second cert' ) ] #NEWLINE# mock_get_cache_data . return_value = ( '\n' . join ( certs ) + '\n' ) #NEWLINE# response = self . _maasservice . get_client_auth_certs ( ) #NEWLINE# mock_get_cache_data . assert_called_with ( ( '%s/meta-data/x509' % response . _maasservice . _metadata_version ) , decode = True ) #NEWLINE# self . assertEqual ( certs , response )