def test_list_no_results(self, db): client = Mock() db.reminders.find.return_value = [] reminders.list_reminders(client, 'sduncan', '#bots') client.msg.assert_called_with( 'sduncan', "There are no reminders for channel: #bots")
def test_simple(self, db): client = Mock() client.msg = client db.reminders.find.return_value = [self.rec] reminders.list_reminders(client, 'sduncan', '#bots') print client.msg.calls client.msg.assert_called_with('sduncan', "sduncan, here are the reminders for channel: #bots\n" "[123456] At 12/11/13 13:15 UTC: 'Standup Time!'")
def test_simple(self, db): client = Mock() client.msg = client db.reminders.find.return_value = [self.rec] reminders.list_reminders(client, 'sduncan', '#bots') print client.msg.calls client.msg.assert_called_with( 'sduncan', "sduncan, here are the reminders for channel: #bots\n" "[123456] At 12/11/13 13:15 UTC: 'Standup Time!'")
def test_with_repeats(self, db): client = Mock() client.msg = client self.rec['repeat'] = [0, 2, 4] db.reminders.find.return_value = [self.rec] reminders.list_reminders(client, 'sduncan', '#bots') print client.msg.calls client.msg.assert_called_with('sduncan', "sduncan, here are the reminders for channel: #bots\n" "[123456] At 12/11/13 13:15 UTC: 'Standup Time!' (Repeat every M,W,F)")
def test_with_repeats(self, db): client = Mock() client.msg = client self.rec['repeat'] = [0, 2, 4] db.reminders.find.return_value = [self.rec] reminders.list_reminders(client, 'sduncan', '#bots') print client.msg.calls client.msg.assert_called_with( 'sduncan', "sduncan, here are the reminders for channel: #bots\n" "[123456] At 12/11/13 13:15 UTC: 'Standup Time!' (Repeat every M,W,F)" )
def test_list_no_results(self, db): client = Mock() db.reminders.find.return_value = [] reminders.list_reminders(client, 'sduncan', '#bots') client.msg.assert_called_with('sduncan', "There are no reminders for channel: #bots")