#NEWLINE# def test_internal_set_host_enabled( self ) : #NEWLINE# #INDENT# self . mox . UnsetStubs ( ) #NEWLINE# service_mock = mock . MagicMock ( ) #NEWLINE# service_mock . configure_mock ( disabled_reason = 'None' , disabled = False ) #NEWLINE# with mock . patch . object ( objects . Service , 'get_by_compute_host' , return_value = service_mock ) : #NEWLINE# #INDENT# self . connection . _set_host_enabled ( False , 'ERROR!' ) #NEWLINE# self . assertTrue ( service_mock . disabled ) #NEWLINE# self . assertEqual ( service_mock . disabled_reason , 'AUTO: ERROR!' )