def test_should_send_message_weekdays(self):
     chat = ChatConfig(days="weekdays",
                       hour=datetime.utcnow().hour,
                       username="******",
                       chat_id="pipipi")
     if datetime.utcnow().weekday() < 5:
         self.assertTrue(chat.should_send_message())
     else:
         self.assertFalse(chat.should_send_message())
 def test_should_not_send_message_chat_id(self):
     chat = ChatConfig(days="daily",
                       hour=datetime.utcnow().hour,
                       username="******",
                       chat_id="")
     self.assertFalse(chat.should_send_message())
 def test_should_send_message_daily(self):
     chat = ChatConfig(days="daily",
                       hour=datetime.utcnow().hour,
                       username="******",
                       chat_id="abc123")
     self.assertTrue(chat.should_send_message())
 def test_should_not_send_message_no_username(self):
     chat = ChatConfig(days="daily",
                       hour=(datetime.utcnow().hour + 2) % 24,
                       username="",
                       chat_id="abc123")
     self.assertFalse(chat.should_send_message())