#NEWLINE# def test_set_host_enabled_when_manually_disabled( self ) : #NEWLINE# #INDENT# self . mox . UnsetStubs ( ) #NEWLINE# service_mock = mock . MagicMock ( ) #NEWLINE# service_mock . configure_mock ( disabled_reason = 'Manually disabled' , disabled = True ) #NEWLINE# with mock . patch . object ( objects . Service , 'get_by_compute_host' , return_value = service_mock ) : #NEWLINE# #INDENT# self . connection . _set_host_enabled ( True ) #NEWLINE# self . assertTrue ( service_mock . disabled ) #NEWLINE# self . assertEqual ( self . disabled_reason , 'Manually disabled' )