#NEWLINE# def test_services_detail( self ) : #NEWLINE# #INDENT# self . ext_mgr . extensions [ 'os-extended-services' ] = True #NEWLINE# req = FakeRequest ( self . wsgi_api_version ) #NEWLINE# res_dict = self . controller . index ( req ) #NEWLINE# response = { #NEWLINE# #INDENT# 'services' : [ { #NEWLINE# #INDENT# 'binary' : 'nova-scheduler' , #NEWLINE# 'host' : 'host1' , #NEWLINE# 'zone' : 'internal' , #NEWLINE# 'status' : 'disabled' , #NEWLINE# 'id' : 1 , #NEWLINE# 'state' : 'up' , #NEWLINE# 'forced_down' : False , #NEWLINE# 'updated_at' : datetime . datetime ( 2012 , 10 , 29 , 13 , 42 , 2 ) , #NEWLINE# 'disabled_reason' : 'test1' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'binary' : 'nova-compute' , #NEWLINE# 'host' : 'host1' , #NEWLINE# 'zone' : 'nova' , #NEWLINE# 'status' : 'disabled' , #NEWLINE# 'state' : 'up' , #NEWLINE# 'id' : 2 , #NEWLINE# 'forced_down' : False , #NEWLINE# 'updated_at' : datetime . datetime ( 2012 , 10 , 29 , 13 , 42 , 5 ) , #NEWLINE# 'disabled_reason' : 'test2' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'binary' : 'nova-scheduler' , #NEWLINE# 'host' : 'host2' , #NEWLINE# 'zone' : 'internal' , #NEWLINE# 'status' : 'enabled' , #NEWLINE# 'id' : 3 , #NEWLINE# 'state' : 'down' , #NEWLINE# 'forced_down' : False , #NEWLINE# 'updated_at' : datetime . datetime ( 2012 , 9 , 19 , 6 , 55 , 34 ) , #NEWLINE# 'disabled_reason' : None , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'binary' : 'nova-compute' , #NEWLINE# 'host' : 'host2' , #NEWLINE# 'zone' : 'nova' , #NEWLINE# 'id' : 4 , #NEWLINE# 'status' : 'disabled' , #NEWLINE# 'state' : 'down' , #NEWLINE# 'forced_down' : False , #NEWLINE# 'updated_at' : datetime . datetime ( 2012 , 9 , 18 , 8 , 3 , 38 ) , #NEWLINE# 'disabled_reason' : 'test4' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . _process_output ( response , has_disabled = True ) #NEWLINE# self . assertEqual ( res_dict , response )