#NEWLINE# @ mock . patch ( 'cloudbaseinit.metadata.services.maasservice.MaaSHttpService._get_cache_data' ) #NEWLINE# def test_get_public_keys( self , mock_get_cache_data ) : #NEWLINE# #INDENT# public_keys = [ 'fake key 1' , 'fake key 2' ] #NEWLINE# public_key = ( '\n' . join ( public_keys ) + '\n' ) #NEWLINE# mock_get_cache_data . return_value = public_key #NEWLINE# response = self . _maasservice . get_public_keys ( ) #NEWLINE# mock_get_cache_data . assert_called_with ( ( '%s/meta-data/public-keys' % self . _maasservice . _metadata_version ) , decode = True ) #NEWLINE# self . assertEqual ( public_key , response )