Esempio n. 1
0
 def test_MonitorConfigInterval(self):
     with self.assertRaises(configparser.NoOptionError):
         testargs = ["monitor.py", "-f", "tests/monitor-nointerval.ini"]
         with patch.object(sys, "argv", testargs):
             monitor.main()
     with self.assertRaises(ValueError):
         testargs = ["monitor.py", "-f", "tests/monitor-badinterval.ini"]
         with patch.object(sys, "argv", testargs):
             monitor.main()
Esempio n. 2
0
 def test_MonitorConfigInterval(self):
     with self.assertRaises(SystemExit):
         testargs = [
             "monitor.py", "-f", "tests/mocks/ini/monitor-nointerval.ini"
         ]
         with patch.object(sys, "argv", testargs):
             monitor.main()
     with self.assertRaises(SystemExit):
         testargs = [
             "monitor.py", "-f", "tests/mocks/ini/monitor-badinterval.ini"
         ]
         with patch.object(sys, "argv", testargs):
             monitor.main()
Esempio n. 3
0
def run_monitor() -> None:

    sys.argv = ["monitor.py", "-vH", "--config={}".format(CONFIG)]
    monitor.main()
Esempio n. 4
0
from simplemonitor import monitor

monitor.main()