Beispiel #1
0
    def test_EventDAO_compose_alert_message_days(self, MockEventDAO, MockMessageApi):
        name = "test_event"
        interval = 86400
        time_diff = 172800

        bo = EventBO(MockEventDAO, MockMessageApi)
        output = bo.compose_alert_message(name, time_diff, interval)
        self.assertEqual(output, "離上一次\"test_event\"已經2天了!")
Beispiel #2
0
    def test_EventDAO_compose_alert_message_days(self, MockEventDAO,
                                                 MockMessageApi):
        name = "test_event"
        interval = 86400
        time_diff = 172800

        bo = EventBO(MockEventDAO, MockMessageApi)
        output = bo.compose_alert_message(name, time_diff, interval)
        self.assertEqual(
            Util.compose_how_long_from_last_time_string(name, 2, "天"), output)