def __init__(self, config, db, queue): self.config = config self.db = db self.queue = queue self.base_url = self.config.server.base_url self.max_retries = self.config.scheduler.max_retries self.reminder_delay = self.config.scheduler.reminder_delay pings = self.config.scheduler.ping self.when = [time_utils.parse_hour(h) for h in pings] # Keys: by (user_id, icu_id), value is ScheduledMessage self.timeouts = {} self.updater = updater.Updater(self.config, None)
def test_parse_hour_test(self): self.assertEqual(time_utils.parse_hour("23:12"), (23, 12)) self.assertEqual(time_utils.parse_hour("23h12", sep='h'), (23, 12)) self.assertEqual(time_utils.parse_hour("wqw"), ("", ""))