#NEWLINE# @ mock . patch ( 'ssl.SSLSocket.getpeercert' , return_value = FAKE_CERT ) #NEWLINE# def test_mock_case( self , getpeercert_func ) : #NEWLINE# #INDENT# self . run_check ( CONFIG_EXPIRED_SSL ) #NEWLINE# self . service_checks = self . wait_for_async ( 'get_service_checks' , 'service_checks' , 2 ) #NEWLINE# tags = [ 'url:https://github.com' , 'instance:expired_cert' ] #NEWLINE# self . assertServiceCheckOK ( 'http.can_connect' , tags = getpeercert_func ) #NEWLINE# self . assertServiceCheckCritical ( 'http.ssl_cert' , tags = tags ) #NEWLINE# self . coverage_report ( )