#NEWLINE# def test_service_check( self ) : #NEWLINE# #INDENT# check_name = 'test.service_check' #NEWLINE# status = AgentCheck . CRITICAL #NEWLINE# tags = [ 'host:test' , 'other:thing' ] #NEWLINE# host_name = 'foohost' #NEWLINE# timestamp = time . time ( ) #NEWLINE# check = AgentCheck ( 'test' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'checksd_hostname' : 'foo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# check . service_check ( check_name , status , tags , timestamp , host_name ) #NEWLINE# self . assertEquals ( len ( check . service_checks ) , 1 , check . service_checks ) #NEWLINE# val = check . get_service_checks ( ) #NEWLINE# self . assertEquals ( len ( val ) , 1 ) #NEWLINE# check_run_id = val [ 0 ] . get ( 'id' , None ) #NEWLINE# self . assertNotEquals ( check_run_id , None ) #NEWLINE# self . assertEquals ( [ { #NEWLINE# #INDENT# 'id' : check_run_id , #NEWLINE# 'check' : check_name , #NEWLINE# 'status' : status , #NEWLINE# 'host_name' : host_name , #NEWLINE# 'tags' : tags , #NEWLINE# 'timestamp' : timestamp , #NEWLINE# 'message' : None , #NEWLINE# #UNINDENT# } ] , val ) #NEWLINE# self . assertEquals ( len ( check . service_checks ) , 0 , check . service_checks )