コード例 #1
0
ファイル: test_util.py プロジェクト: sbakiu/m3d-api
 def test_send_mail(self, os_system_patch):
     Util.send_email(["*****@*****.**"], "hello", "hello")
     os_system_patch.assert_has_calls([
         call(
             'echo "hello" | mailx -s "hello" [email protected]'
         )
     ])
コード例 #2
0
    def _report_error(self, name):
        error_subject = "Error for " + name
        exec_tb = traceback.format_exc()
        message = "Error in executing {}. \n Stacktrace: \n {}".format(
            name, exec_tb)

        logging.error(error_subject)
        Util.send_email(self._execution_system.config_service.emails,
                        error_subject, message)
コード例 #3
0
 def _report_success(self, name):
     success_subject = "Success for " + name
     logging.info(success_subject)
     Util.send_email(self._execution_system.config_service.emails,
                     success_subject, success_subject)