def test_expiring(self): input_args = self.base_arg + ["-t", "1s", "-c", "sleep 2"] with self.assertRaises(SystemExit): main(input_args) input_args = self.base_arg + ["-t", "3s", "-c", "sleep 2"] main(input_args) #does not raise
#!/usr/bin/env python """ starter script to be used during development (where paths would otherwise be messed up) :copyright: 2015 by Matthias Kauer :license: BSD """ import sys try: import _preamble except ImportError: sys.exit(-1) from croncoat.scripts.ccscript import main main()
def test_success(self): input_args = self.base_arg + ['-c', 'ls -la'] main(input_args) input_args = self.base_arg + ['-v', '-c', 'ls -la'] main(input_args)
def test_errorcode(self): input_args = self.base_arg + [ '-c', 'python -c "import sys; sys.exit(1)"' ] with self.assertRaises(SystemExit): main(input_args)
def test_errorcode(self): input_args = self.base_arg + ['-c', 'python -c "import sys; sys.exit(1)"'] with self.assertRaises(SystemExit): main(input_args)