Package epyunit :: Package unittest :: Module subprocess :: Class TestExecutable
[hide private]
[frames] | no frames]

Class TestExecutable

source code


Extends TestCase for subprocesses.
Nested Classes [hide private]

Inherited from unittest.case.TestCase: failureException

Instance Methods [hide private]
 
__init__(self, *args, **kargs)
Initializes the test case, passes parameters to 'unittest.TestCase'.
source code
 
setkargs(self, **kargs)
Sets provided parameters for the subprocess call context.
source code
 
callSubprocess(self, callstr, **kargs)
Calls a subprocess and fetches the result data.
source code
 
assertEqual(self, exp, cur=None)
Asserts tuple result value of the called process.
source code
 
assertExit(self, exp, cur=None)
Asserts on the exit value of the called process.
source code
 
assertExists(self, fpname)
Asserts on the existance of a filesystem node.
source code
 
assertStdout(self, exp, cur=None)
Asserts a list of provided regexpr on the STDOUT of the called process.
source code
 
assertStderr(self, exp, cur=None)
Asserts a list of provided regexpr on the STDERR of the called process.
source code
 
assertSubprocess(self, callstr, res, **kargs)
Calls a subprocess and asserts the result data.
source code
 
__str__(self)
Prints the current test state.
source code

Inherited from unittest.case.TestCase: __call__, __eq__, __hash__, __ne__, __repr__, addCleanup, addTypeEqualityFunc, assertAlmostEqual, assertAlmostEquals, assertDictContainsSubset, assertDictEqual, assertEquals, assertFalse, assertGreater, assertGreaterEqual, assertIn, assertIs, assertIsInstance, assertIsNone, assertIsNot, assertIsNotNone, assertItemsEqual, assertLess, assertLessEqual, assertListEqual, assertMultiLineEqual, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertNotIn, assertNotIsInstance, assertNotRegexpMatches, assertRaises, assertRaisesRegexp, assertRegexpMatches, assertSequenceEqual, assertSetEqual, assertTrue, assertTupleEqual, assert_, countTestCases, debug, defaultTestResult, doCleanups, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, setUp, shortDescription, skipTest, tearDown

Inherited from unittest.case.TestCase (private): _addSkip, _baseAssertEqual, _deprecate, _formatMessage, _getAssertEqualityFunc, _truncateMessage

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from unittest.case.TestCase: setUpClass, tearDownClass

Class Variables [hide private]

Inherited from unittest.case.TestCase: longMessage, maxDiff

Inherited from unittest.case.TestCase (private): _classSetupFailed, _diffThreshold

Instance Variables [hide private]
  spunit
Subprocess unit assigned to this test case.
  spcache
Subprocess output caches.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kargs)
(Constructor)

source code 

Initializes the test case, passes parameters to 'unittest.TestCase'.

Args:
**kargs: Parameter specific for the operation,
passed through to setkargs.
Returns:
When successful returns 'True'.
Raises:
passed through exceptions:
Overrides: object.__init__

setkargs(self, **kargs)

source code 

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:

callSubprocess(self, callstr, **kargs)

source code 

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:

assertEqual(self, exp, cur=None)

source code 

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.
Overrides: unittest.case.TestCase.assertEqual

assertExit(self, exp, cur=None)

source code 

Asserts on the exit value of the called process.

Args:
exp: Expected value:
exit-value
cur: Current value:

exit-value

default:=self.spcache[0]

Returns:
When successful returns the True, else raises an exception.
Raises:
Raises result of assertEqual.

assertExists(self, fpname)

source code 

Asserts on the existance of a filesystem node.

Args:
fpname: Filesystem node.
Returns:
When successful returns the True, else raises an exception.
Raises:
Raises result FileNodeDoesNotExists.

assertStdout(self, exp, cur=None)

source code 

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.

assertStderr(self, exp, cur=None)

source code 

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.

assertSubprocess(self, callstr, res, **kargs)

source code 

Calls a subprocess and asserts the result data.

Args:
callstr:
Complete call string for subprocess.
res:

Result from 'TestExecutable.callSubprocess()'

returnvalue := (exit-value, stdout-value, stderr-value)
**kargs:

Pass-through parameters for 'SystemCalls.callit()'.

cache:
Caches results.
Returns:
When successful returns True, else raises exception.
Raises:
passed through exceptions:

__str__(self)
(Informal representation operator)

source code 
Prints the current test state.
Overrides: object.__str__