示例#1
0
    def test_notify_set_lineup(self):
        mock_client = MockClient()
        n = Notifier(mock_client)

        team = "Team1"
        ts = [self.t1, self.t2]

        n.notify_set_lineup(team, self.lt1, ts, [ScoringSetting(BaseballStat.H, False, 0.0)])

        msg = team + ": 50.00PA\n10.00H "
        for t in ts:
            msg += "\n" + Notifier.transition_message(t)

        (msg_rec, url_rec) = mock_client.messages[0]

        self.assertEqual(msg, msg_rec)
        self.assertEqual(None, url_rec)
示例#2
0
    def test_notify_ignore_non_hitting_stat(self):
        mock_client = MockClient()
        n = Notifier(mock_client)

        team = "Name"
        ts = [self.t1, self.t2]

        n.notify_set_lineup(
            team, self.lt1, ts, [ScoringSetting(BaseballStat.WHIP, True, 0.0)]
        )

        expected = team + ": 50.00PA\n"
        for t in ts:
            expected += "\n" + Notifier.transition_message(t)

        (msg_rec, url_rec) = mock_client.messages[0]

        self.assertEqual(expected, msg_rec)
        self.assertEqual(None, url_rec)