Exemplo n.º 1
0
 def test_no_failed(self):
     s = simplemonitor.SimpleMonitor("tests/monitor-empty.ini")
     m1 = MonitorNull("null1", config_options={})
     m2 = MonitorNull("null2", config_options={})
     s.add_monitor("null1", m1)
     s.add_monitor("null2", m2)
     m2.reset_dependencies()
     m1.run_test()
     failed = s._failed_monitors()
     self.assertListEqual([], failed)
Exemplo n.º 2
0
 def test_disabled(self):
     s = simplemonitor.SimpleMonitor("tests/monitor-empty.ini")
     m1 = MonitorFail("fail", config_options={})
     m2 = MonitorNull("null", config_options={"enabled": "0"})
     s.add_monitor("fail", m1)
     s.add_monitor("null", m2)
     m2.reset_dependencies()
     m1.run_test()
     failed = s._failed_monitors()
     self.assertListEqual(["fail", "null"], failed)