コード例 #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")
コード例 #2
0
ファイル: test_reminders.py プロジェクト: michaelorr/helga
    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!'")
コード例 #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!'")
コード例 #4
0
ファイル: test_reminders.py プロジェクト: michaelorr/helga
    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)")
コード例 #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)"
        )
コード例 #6
0
ファイル: test_reminders.py プロジェクト: michaelorr/helga
    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")