def test_execute_day_is_holiday(self):
with freezegun.freeze_time('2016-12-01 11:00'):
self.task.execute(self.bot, self.slack)
task = self.bot.fast_queue.pop()
self.assertIsInstance(task, pony.tasks.SendMessage)
self.assertEqual(task.to, '#dev-team')
self.assertIn('No Standup Today', task.text)
self.assertIn('Romanian National Day', task.text)
# this is sent only once (report is marked reported)
self.task.execute(self.bot, self.slack)
with self.assertRaises(IndexError):
self.bot.fast_queue.pop()
self.assertIsNotNone(
self.bot.storage.get('report')[
date(2016, 12, 1)
]['dev_team1'].get('reported_at')
)
test_tasks_check_reports.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录