Package epyunit ::
Module SystemCalls
|
|
Module SystemCalls
source code
The module 'epyunit.SystemCalls' provides the controlled execution of subprocesses as units.
The features are foreseen to support easy setups for unit and regression
tests on complex command line options and their combinations.
These are in designed to be used in conjunction with
with PyUnit, either within Eclipse and PyDev, or from the command line.
The provided feature set is supported on the platforms: Linux, MacOS, BSD, Solaris, and Windows.
A quick example call is:
python -c 'from epyunit.SystemCalls import SystemCalls;x=SystemCalls(**{"proceed":"trace"});x.callit("myscript.sh xOK")'
or:
python -c 'from epyunit.SystemCalls import SystemCalls;x=SystemCalls(**{"proceed":"trace"});x.callit("myscript.py xOK")'
SECURITY REMARK: Current version supports for subprocesses the ShellMode only.
For test environments in R&D this - hopefully - is perfectly OK,
else eventual security issues has to be considered.
Version:
0.2.1
Author:
Arno-Can Uestuensoez
Copyright:
Copyright (C) 2010-2016 Arno-Can Uestuensoez @Ingenieurbuero
Arno-Can Uestuensoez
License:
Artistic-License-2.0 + Forced-Fairplay-Constraints
|
output(s,
_o=None)
Directs the output stream
Args:
s: String for output
_o: Output channel:
_O_STD, _O_ERR, _O_STR |
source code
|
|
|
__uuid__ = ' 9de52399-7752-4633-9fdc-66c87a9200b8 '
|
|
version = ' 2.7 '
|
|
_O_STD = 1
output to STDOUT
|
|
_O_ERR = 2
output to STDERR
|
|
_O_STR = 3
output to STRING
|
|
_outdefault = 3
|
|
_CSPLTL = re.compile(r'\r* \n')
Split lines on Windows too including with contained multiple(???) '
'
|
|
__package__ = None
|
Directs the output stream
Args:
s: String for output
_o: Output channel:
_O_STD, _O_ERR, _O_STR
Returns:
_o == _O_STD: string
_o == _O_ERR: prints to STDERR, returns True
_o == _O_STR: prints to STDOUT, returns True
else: returns False
Raises:
pass/through
|