Пример #1
0
 def test_continuous_previous_gmailmultiple(self):
     with open("examples/2020-04-08.xml", "r") as f:
         currentStatus = "".join(f.readlines())
     alerts = compareStatus(currentStatus, "examples/normal.xml",
                            "continuous", ["Gmail"], False)
     for alert in alerts:
         self.assertTrue(alert.title in ["Gmail"])
     self.assertTrue(len(alerts) == 3)
Пример #2
0
 def test_statechange_noprevious_gmailonly(self):
     with open("examples/2014-11-25.xml", "r") as f:
         currentStatus = "".join(f.readlines())
     alerts = compareStatus(currentStatus, "examples/null.xml",
                            "statechange", ["Gmail"], False)
     for alert in alerts:
         self.assertTrue(alert.title in ["Gmail"])
     self.assertTrue(len(alerts) == 1)
Пример #3
0
 def test_blacklist_many_services(self):
     with open("examples/2020-03-04.xml", "r") as f:
         currentStatus = "".join(f.readlines())
     blacklist = ["Google Sheets", "Google Sites"]
     alerts = compareStatus(currentStatus, "examples/normal.xml",
                            "continuous", blacklist, True)
     for alert in alerts:
         self.assertTrue(alert.title not in blacklist)
     self.assertTrue(len(alerts) == 22)
Пример #4
0
 def test_continuous_previous_gmailblacklist(self):
     with open("examples/2020-04-08.xml", "r") as f:
         currentStatus = "".join(f.readlines())
     alerts = compareStatus(currentStatus, "examples/normal.xml",
                            "continuous", ["Gmail"], True)
     self.assertTrue(len(alerts) == 0)
Пример #5
0
 def test_statechange_noprevious_gmailblacklist(self):
     with open("examples/2020-04-08.xml", "r") as f:
         currentStatus = "".join(f.readlines())
     alerts = compareStatus(currentStatus, "examples/null.xml",
                            "statechange", ["Gmail"], True)
     self.assertTrue(len(alerts) == 0)