Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
#!/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()
Пример #4
0
    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)
Пример #5
0
 def test_errorcode(self):
     input_args = self.base_arg + [
         '-c', 'python -c "import sys; sys.exit(1)"'
     ]
     with self.assertRaises(SystemExit):
         main(input_args)
Пример #6
0
#!/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()
Пример #7
0
    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)
Пример #8
0
 def test_errorcode(self):
     input_args = self.base_arg + ['-c', 'python -c "import sys; sys.exit(1)"']
     with self.assertRaises(SystemExit):
         main(input_args)