#NEWLINE# def test_services_enable( self ) : #NEWLINE# #INDENT# def _service_update( context , service_id , values ) : #NEWLINE# #INDENT# self . assertIsNone ( values [ 'disabled_reason' ] ) #NEWLINE# return dict ( test_service . fake_service , id = service_id , ** values ) #NEWLINE# #UNINDENT# self . stub_out ( 'nova.db.service_update' , _service_update ) #NEWLINE# body = { #NEWLINE# #INDENT# 'host' : 'host1' , #NEWLINE# 'binary' : 'nova-compute' , #NEWLINE# #UNINDENT# } #NEWLINE# res_dict = self . controller . update ( self . req , 'enable' , body = body ) #NEWLINE# self . assertEqual ( res_dict [ 'service' ] [ 'status' ] , 'enabled' ) #NEWLINE# self . assertNotIn ( 'disabled_reason' , res_dict [ 'service' ] )