def test_at_time_error(self, bot_mock): chat_id = 0 text = "/set at 340:12230 Future time." ok = ParserService.parse_command(chat_id, text) self.assertFalse(ok)
def test_at_hour_one_figure(self, bot_mock): chat_id = 0 text = "/set at 1:30 Sleep time." ok = ParserService.parse_command(chat_id, text) self.assertTrue(ok)
def test_at_minute(self, bot_mock): chat_id = 0 text = "/set at 20:30 Dinner time." ok = ParserService.parse_command(chat_id, text) self.assertTrue(ok)
def text_received(chat_id, text): if not ParserService.parse_command(chat_id, text): BOT.sendMessage(chat_id=chat_id, text=HELP_TXT, parse_mode=telegram.ParseMode.MARKDOWN)