#NEWLINE# @ mock . patch ( 'nova.volume.cinder.cinderclient' ) #NEWLINE# def test_attach( self , mock_cinderclient ) : #NEWLINE# #INDENT# mock_volumes = mock . MagicMock ( ) #NEWLINE# mock_cinderclient . return_value = mock . MagicMock ( volumes = mock_volumes ) #NEWLINE# self . api . attach ( self . ctx , 'id1' , 'uuid' , 'point' ) #NEWLINE# mock_cinderclient . assert_called_once_with ( self . ctx ) #NEWLINE# mock_volumes . attach . assert_called_once_with ( 'id1' , 'uuid' , 'point' , mode = 'rw' )