コード例 #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()
コード例 #2
0
ファイル: test_main.py プロジェクト: sclub/simplemonitor
 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()
コード例 #3
0
ファイル: winmonitor.py プロジェクト: mrgfisher/simplemonitor
def run_monitor() -> None:

    sys.argv = ["monitor.py", "-vH", "--config={}".format(CONFIG)]
    monitor.main()
コード例 #4
0
ファイル: monitor.py プロジェクト: mrgfisher/simplemonitor
from simplemonitor import monitor

monitor.main()