def test_remind_nomsg(self): secs = 5 self.input.sender = '#testsworth' self.input.nick = 'Testsworth' self.input.bytes = '.in {0} seconds'.format(secs) remind.remind(self.phenny, self.input) self.phenny.reply.assert_called_once_with("Okay, will remind in {0}" " secs".format(secs)) time.sleep(secs + 1) self.phenny.msg.assert_called_once_with(self.input.sender, self.input.nick + '!')
def test_remind(self): secs = 5 input = Mock(sender='#testsworth', nick='Testsworth', bytes='.in {0} seconds TEST REMIND'.format(secs)) remind.remind(self.phenny, input) self.phenny.reply.assert_called_once_with("Okay, will remind in {0}"\ " secs".format(secs)) time.sleep(secs + 1) self.phenny.msg.assert_called_once_with(input.sender, input.nick + ': TEST REMIND')