コード例 #1
0
    def test_survive_nonexisting_senders(self):
        a = Alerter("foo,bar")

        a.run(self.alerts)
        a.send_alerts()

        self.assertTrue(a.recorded_alerts is not None)
コード例 #2
0
    def test_multiple_run_keeps_details(self):
        a = Alerter("")

        a.run(self.alerts[0:2])
        a.run(self.alerts[2:])

        self.assertEquals(5, len(a.recorded_alerts))
コード例 #3
0
    def test_flatten_details(self):
        a = Alerter("")

        a.run(self.alerts)

        self.assertEquals(3, len(a.recorded_alerts))
        self.assertTrue(any(x[0] == "complex" for x in a.recorded_alerts))
        self.assertTrue(any(x[1] == "_2_" for x in a.recorded_alerts))
コード例 #4
0
    def test_flatten_details(self):
        a = Alerter("")

        a.run(self.alerts)

        self.assertEquals(5, len(a.recorded_alerts))
        self.assertTrue(any(x[0] == "complex" for x in a.recorded_alerts))
        self.assertTrue(any(x[1] == "_2_" for x in a.recorded_alerts))
コード例 #5
0
    def test_multiple_run_keeps_details(self):
        a = Alerter("")

        a.run(self.alerts[0:2])
        a.run(self.alerts[2:])

        self.assertEquals(3, len(a.recorded_alerts))
コード例 #6
0
    def test_survive_nonexisting_senders(self):
        a = Alerter("foo,bar")

        a.run(self.alerts)
        a.send_alerts()

        self.assertTrue(a.recorded_alerts is not None)