#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . nova : ( 'service_list' , 'availability_zone_list' , 'aggregate_list' ) , #NEWLINE# api . neutron : ( 'agent_list' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_index( self ) : #NEWLINE# #INDENT# services = self . services . list ( ) #NEWLINE# api . nova . service_list ( IsA ( http . HttpRequest ) ) . AndReturn ( services ) #NEWLINE# api . nova . availability_zone_list ( IsA ( http . HttpRequest ) , detailed = True ) . AndReturn ( self . availability_zones . list ( ) ) #NEWLINE# api . nova . aggregate_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . aggregates . list ( ) ) #NEWLINE# agents = self . agents . list ( ) #NEWLINE# api . neutron . agent_list ( IsA ( http . HttpRequest ) ) . AndReturn ( agents ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . get ( INDEX_URL ) #NEWLINE# self . assertTemplateUsed ( res , 'admin/info/index.html' ) #NEWLINE# services_tab = res . context [ 'tab_group' ] . get_tab ( 'services' ) #NEWLINE# self . assertQuerysetEqual ( services_tab . _tables [ 'services' ] . data , [ '<Service: compute>' , '<Service: volume>' , '<Service: image>' , '<Service: identity (native backend)>' , '<Service: object-store>' , '<Service: network>' , '<Service: ec2>' , '<Service: metering>' , '<Service: orchestration>' , '<Service: database>' ] ) #NEWLINE# zones_tab = res . context [ 'tab_group' ] . get_tab ( 'zones' ) #NEWLINE# self . assertQuerysetEqual ( zones_tab . _tables [ 'zones' ] . data , [ '<AvailabilityZone: nova>' ] ) #NEWLINE# aggregates_tab = res . context [ 'tab_group' ] . get_tab ( 'aggregates' ) #NEWLINE# self . assertQuerysetEqual ( aggregates_tab . _tables [ 'aggregates' ] . data , [ '<Aggregate: 1>' , '<Aggregate: 2>' ] ) #NEWLINE# network_agents_tab = res . context [ 'tab_group' ] . get_tab ( 'network_agents' ) #NEWLINE# self . assertQuerysetEqual ( network_agents_tab . _tables [ 'network_agents' ] . data , [ agent . __repr__ ( ) for agent in self . agents . list ( ) ] )