Esempio n. 1
0
    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")
Esempio n. 2
0
    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!'")
Esempio n. 3
0
    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!'")
Esempio n. 4
0
    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)")
Esempio n. 5
0
    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)"
        )
Esempio n. 6
0
    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")