#NEWLINE# def test_service_is_up( self ) : #NEWLINE# #INDENT# '' #NEWLINE# member = { #NEWLINE# #INDENT# 'host' : 'fake-host' , #NEWLINE# 'topic' : 'compute' , #NEWLINE# 'forced_down' : False , #NEWLINE# #UNINDENT# } #NEWLINE# for retval in ( True , False ) : #NEWLINE# #INDENT# driver = self . servicegroup_api . _driver #NEWLINE# driver . is_up = mock . MagicMock ( return_value = retval ) #NEWLINE# result = self . servicegroup_api . service_is_up ( member ) #NEWLINE# self . assertIs ( result , retval ) #NEWLINE# driver . is_up . assert_called_with ( member ) #NEWLINE# #UNINDENT# member [ 'forced_down' ] = True #NEWLINE# for retval in ( True , False ) : #NEWLINE# #INDENT# driver = self . servicegroup_api . _driver #NEWLINE# result = self . servicegroup_api . service_is_up ( member ) #NEWLINE# self . assertIs ( result , False )