#NEWLINE# @ mock . patch ( 'nova.api.openstack.common.ViewBuilder._get_next_link' ) #NEWLINE# def test_items_equals_given_limit( self , href_link_mock ) : #NEWLINE# #INDENT# items = [ { #NEWLINE# #INDENT# 'uuid' : '123' , #NEWLINE# #UNINDENT# } ] #NEWLINE# req = mock . MagicMock ( ) #NEWLINE# params = mock . PropertyMock ( return_value = dict ( limit = 1 ) ) #NEWLINE# type ( req ) . params = params #NEWLINE# builder = common . ViewBuilder ( ) #NEWLINE# results = builder . _get_collection_links ( req , req , mock . sentinel . coll_key , 'uuid' ) #NEWLINE# href_link_mock . assert_called_once_with ( req , '123' , mock . sentinel . coll_key ) #NEWLINE# self . assertThat ( results , matchers . HasLength ( 1 ) )