<s> from django . core . urlresolvers import reverse <EOL> from django import http <EOL> from mox import IgnoreArg <EOL> from mox import IsA <EOL> from openstack_dashboard import api <EOL> from openstack_dashboard . test import helpers as test <EOL> INDEX_URL = reverse ( '<STR_LIT>' ) <EOL> class SystemInfoViewTests ( test . BaseAdminViewTests ) : <EOL> @ test . create_stubs ( { api . base : ( '<STR_LIT>' , ) , <EOL> api . nova : ( '<STR_LIT>' , ) , <EOL> api . neutron : ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> api . cinder : ( '<STR_LIT>' , ) } ) <EOL> def test_index ( self ) : <EOL> services = self . services . list ( ) <EOL> api . nova . service_list ( IsA ( http . HttpRequest ) ) . AndReturn ( services ) <EOL> api . base . is_service_enabled ( IsA ( http . HttpRequest ) , IgnoreArg ( ) ) . MultipleTimes ( ) . AndReturn ( True ) <EOL> api . neutron . is_extension_supported ( IsA ( http . HttpRequest ) , <EOL> '<STR_LIT>' ) . AndReturn ( True ) <EOL> agents = self . agents . list ( ) <EOL> api . neutron . agent_list ( IsA ( http . HttpRequest ) ) . AndReturn ( agents ) <EOL> cinder_services = self . cinder_services . list ( ) <EOL> api . cinder . service_list ( IsA ( http . HttpRequest ) ) . AndReturn ( cinder_services ) <EOL> self . mox . ReplayAll ( ) <EOL> res = self . client . get ( INDEX_URL ) <EOL> self . assertTemplateUsed ( res , '<STR_LIT>' ) <EOL> services_tab = res . context [ '<STR_LIT>' ] . get_tab ( '<STR_LIT>' ) <EOL> self . assertQuerysetEqual ( services_tab . _tables [ '<STR_LIT>' ] . data , <EOL> [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , ] ) <EOL> network_agents_tab = res . context [ '<STR_LIT>' ] . get_tab ( '<STR_LIT>' ) <EOL> self . assertQuerysetEqual ( <EOL> network_agents_tab . _tables [ '<STR_LIT>' ] . data , <EOL> [ agent . __repr__ ( ) for agent in self . agents . list ( ) ] <EOL> ) <EOL> self . mox . VerifyAll ( ) <EOL> @ test . create_stubs ( { api . base : ( '<STR_LIT>' , ) , <EOL> api . cinder : ( '<STR_LIT>' , ) , <EOL> api . nova : ( '<STR_LIT>' , ) , <EOL> api . neutron : ( '<STR_LIT>' , '<STR_LIT>' ) } ) <EOL> def test_cinder_services_index ( self ) : <EOL> cinder_services = self . cinder_services . list ( ) <EOL> api . nova . service_list ( IsA ( http . HttpRequest ) ) . AndReturn ( [ ] ) <EOL> api . cinder . service_list ( IsA ( http . HttpRequest ) ) . AndReturn ( cinder_services ) <EOL> api . neutron . agent_list ( IsA ( http . HttpRequest ) ) . AndReturn ( [ ] ) <EOL> api . base . is_service_enabled ( IsA ( http . HttpRequest ) , IgnoreArg ( ) ) . MultipleTimes ( ) . AndReturn ( True ) <EOL> api . neutron . is_extension_supported ( IsA ( http . HttpRequest ) , <EOL> '<STR_LIT>' ) . AndReturn ( True ) <EOL> self . mox . ReplayAll ( ) <EOL> res = self . client . get ( INDEX_URL ) <EOL> cinder_services_tab = res . context [ '<STR_LIT>' ] . get_tab ( '<STR_LIT>' ) <EOL> self . assertTemplateUsed ( res , '<STR_LIT>' ) <EOL> self . assertQuerysetEqual ( cinder_services_tab . _tables <EOL> [ '<STR_LIT>' ] . data , <EOL> [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) </s>
