#NEWLINE# @ mock . patch ( 'nova.db.agent_build_get_all' ) #NEWLINE# def test_get_all( self , mock_get_all ) : #NEWLINE# #INDENT# mock_get_all . return_value = [ fake_agent ] #NEWLINE# agents = agent_obj . AgentList . get_all ( self . context , hypervisor = 'novavm' ) #NEWLINE# self . assertEqual ( 1 , len ( agents ) ) #NEWLINE# self . _compare ( self , fake_agent , agents [ 0 ] ) #NEWLINE# mock_get_all . assert_called_once_with ( self . context , hypervisor = 'novavm' )