‘epyunit.unittest.subprocess’ - Module¶
The module ‘epyunit.unittest.subprocess’ provides classes derived from ‘unittest’ for tests of arbitrary subprocesses.
Class: TestExecutable¶
-
class
epyunit.unittest.subprocess.
TestExecutable
(*args, **kargs)[source]¶ Extends TestCase for subprocesses.
Methods¶
__init__¶
assertEqual¶
-
TestExecutable.
assertEqual
(exp, cur=None)[source]¶ Asserts tuple result value of the called process.
- Args:
- exp: Expected value:
- (exit-value, stdout-value, stderr-value)
- cur: Current value:
(exit-value, stdout-value, stderr-value)
default:=self.spcache
- Returns:
- When successful returns the True, else raises an exception.
- Raises:
- Raises result of assertEqueal.
assertExit¶
assertExists¶
assertStderr¶
-
TestExecutable.
assertStderr
(exp, cur=None)[source]¶ Asserts a list of provided regexpr on the STDERR of the called process.
- Args:
- exp: Expected value:
- stderr-value
- cur: Current value:
stderr-value
default:=self.spcache[2]
- Returns:
- When successful returns the True, else raises an exception.
- Raises:
- Raises result of assertEqual.
assertStdout¶
-
TestExecutable.
assertStdout
(exp, cur=None)[source]¶ Asserts a list of provided regexpr on the STDOUT of the called process.
- Args:
- exp: Expected value:
- stdout-value
- cur: Current value:
stdout-value
default:=self.spcache[1]
- Returns:
- When successful returns the True, else raises an exception.
- Raises:
- Raises result of assertEqual.
callSubprocess¶
-
TestExecutable.
callSubprocess
(callstr, **kargs)[source]¶ Calls a subprocess and fetches the result data.
- Args:
callstr: Complete call string for subprocess.
- **kargs:
Pass-through parameters for ‘SystemCalls.callit()’.
- cache:
- Caches results.
- Returns:
When successful returns the tupel:
returnvalue := (exit-value, stdout-value, stderr-value)- Raises:
- passed through exceptions:
setkargs¶
-
TestExecutable.
setkargs
(**kargs)[source]¶ Sets provided parameters for the subprocess call context.
Applicable for the initial call of self.__init__(), and later modification. Called for each start of a subprocess in order to update optional the specific call context modification.
- Args:
**kargs: Parameters specific for the operations.
- cache:
- Sets caching of the results for subprocess call.
- noparent:
- Suppress call of parent class.
- rules:
- Sets the rules object to be used. See: epyunit.SubprocUnit.SProcUnitRules
- spunit:
- Sets the subprocess unit. See: epyunit.SubprocUnit.SProcUnit
- Returns:
- When successful returns ‘True’, else returns either ‘False’, or raises an exception.
- Raises:
- passed through exceptions: