#NEWLINE# def test_mgr_add_health_monitor( self ) : #NEWLINE# #INDENT# lb = self . loadbalancer #NEWLINE# mgr = lb . manager #NEWLINE# mgr . api . method_put = Mock ( return_value = ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# fake_type = 'HTTP' #NEWLINE# fake_delay = 99 #NEWLINE# fake_timeout = 99 #NEWLINE# fake_attemptsBeforeDeactivation = 99 #NEWLINE# fake_path = '/fake' #NEWLINE# fake_statusRegex = '.*fake.*' #NEWLINE# fake_bodyRegex = '.*fake.*' #NEWLINE# fake_hostHeader = 'fake' #NEWLINE# lb . protocol = fake_type #NEWLINE# mgr . add_health_monitor ( lb , type = fake_type , delay = fake_delay , timeout = fake_timeout , attemptsBeforeDeactivation = fake_attemptsBeforeDeactivation , path = fake_path , statusRegex = fake_statusRegex , bodyRegex = fake_bodyRegex , hostHeader = fake_hostHeader ) #NEWLINE# uri = ( '/loadbalancers/%s/healthmonitor' % lb . id ) #NEWLINE# req_body = { #NEWLINE# #INDENT# 'healthMonitor' : { #NEWLINE# #INDENT# 'type' : fake_type , #NEWLINE# 'delay' : fake_delay , #NEWLINE# 'timeout' : fake_timeout , #NEWLINE# 'attemptsBeforeDeactivation' : fake_attemptsBeforeDeactivation , #NEWLINE# 'path' : fake_path , #NEWLINE# 'statusRegex' : fake_statusRegex , #NEWLINE# 'bodyRegex' : fake_bodyRegex , #NEWLINE# 'hostHeader' : fake_hostHeader , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# mgr . api . method_put . assert_called_once_with ( uri , body = req_body )