示例#1
0
    def test_EventBO_send_notification_should_not_send(self, MockEventDAO, MockMessageApi):
        MockEventDAO.query_all_events.return_value = [
            {"created_time": 10000,
             "name": "test_target",
             "interval": 100,
             "target": "test_target"}
        ]
        bo = EventBO(MockEventDAO, MockMessageApi)
        bo.send_notification(current_time=10001)

        MockMessageApi.send_reset_confirm_message.assert_not_called()
        MockEventDAO.update_last_notified_time.assert_not_called()
示例#2
0
# -*- coding: utf-8 -*-

import os
import logging

from apscheduler.schedulers.blocking import BlockingScheduler

from message import send_text_message
from bo import EventBO

bo = EventBO()

# sched = BlockingScheduler()
# @sched.scheduled_job('cron', minute="*")
# def scheduled_job():
# 	bo.send_notification()
# sched.start()

bo.send_notification()