TestCenter Reference
TestSupport.Base Namespace Reference

Basic support functions. More...

Classes

class  HtmlDiff
 
class  MacrosShouldLogOnSuccessDecorator
 Decorator to globally enable or disable if the ASSERT_*/EXPECT_* macros log an info message on success. More...
 

Functions

 clearEncodingCache ()
 
 getSourceFileEncoding (filename)
 
 decodeSourceCodeLine (filename, line)
 
 getPackageList ()
 Returns the list of available packages.
 
 getTestCaseContext ()
 Get the context of the test.
 
 getModuleName ()
 Return the name of the currently tested module.
 
 getTestFunctionName ()
 Returns the name of the current test function.
 
 setMacrosShouldLogOnSuccess (logOnSuccess)
 Globally enables or disables if the ASSERT_*/EXPECT_* macros log an info message on success.
 
 shouldLogOnSuccess (logOnSuccess=None)
 
 LoggingDecorator (func)
 Internal decorator used for creating messages in compare methods.
 
 escapedUnicode (value)
 
 compareEqual (a, b, comment="", logOnSuccess=None)
 Compare the two given values for equality.
 
 compareNotEqual (a, b, comment="", logOnSuccess=None)
 Compare the two given values for inequality.
 
 compareLessThan (a, b, comment="", logOnSuccess=None)
 Compare the two given values if the first one is less than the second.
 
 compareLessThanOrEqual (a, b, comment="", logOnSuccess=None)
 Compare the two given values if the first one is less than or equal to the second.
 
 compareFloatEqual (a, b, comment="", epsilon=0.0001, logOnSuccess=None)
 Compare the two given float values if they are epsilon-equal.
 
 compareFloatNotEqual (a, b, comment="", epsilon=0.0001, logOnSuccess=None)
 Compare the two given float values if they are epsilon-unequal.
 
 compareFloatLessThan (a, b, comment="", logOnSuccess=None)
 Compare the two given float values if the first is less than the second.
 
 compareFloatLessThanOrEqual (a, b, comment="", epsilon=0.0001, logOnSuccess=None)
 Compare the two given float values if the first is less than or equal to the second.
 
 verifyTrue (expr, comment="", logOnSuccess=None, msg=None)
 If the given expression evaluates to False, an error is logged.
 
 verifyFalse (expr, comment="", logOnSuccess=None, msg=None)
 If the given expression evaluates to True, an error is logged.
 
 expectError (function, args=[], kargs={}, errorRegExp=None, preventReplacingMessageSeverity=False)
 Call the given function with the given parameters and expect an error.
 
 expectWarning (function, args=[], kargs={}, warningRegExp=None)
 Call the given function with the given parameters and expect a warning.
 
 expectWarningAndError (function, args=[], kargs={}, errorRegExp=None, warningRegExp=None)
 Call the given function with the given parameters and expect both a warning and an error.
 
 ignoreError (function, args=(), kargs=None, errorRegExp=None, resultInfoDict=None)
 Call the given function with the given parameters and ignores potential errors.
 
 ignoreWarning (function, args=(), kargs=None, warningRegExp=None, resultInfoDict=None)
 Call the given function with the given parameters and ignores potential warnings.
 
 ignoreWarningAndError (function, args=[], kargs={}, errorRegExp=None, warningRegExp=None, resultInfoDict=None)
 Call the given function with the given parameters and ignore both a warning and an error.
 
 expectInfo (function, args=[], kargs={}, infoRegExp=None, allowUnexpectedMessages=True)
 Call the given function with the given parameters and expect an info message.
 
 hasNoWarning (warningRegExp=None)
 
 hasWarning (warningRegExp=None)
 
 hasError (errorRegExp=None)
 
 hasWarningAndError (errorRegExp=None, warningRegExp=None)
 
 hasInfo (infoRegExp=None, allowUnexpectedMessages=True)
 
 getResultDirectory ()
 Getter for the directory used to save results.
 
 getDataDirectory ()
 Method to return path to the data files.
 
 getFileInDataDirectory (filename)
 Returns the absolute filename of a file in the data directory using getDataDirectory().
 
 existsFileInDataDirectory (filename)
 Checks if the given file exists in the data directory.
 
 getExternalDataDirectory (name, subDirectory=None)
 Method to return path to the external data directory.
 
 pushChangeSet ()
 Push a new ChangeSet to the stack.
 
 popChangeSet ()
 Pop the last ChangeSet from the stack.
 
 getHash (filename, hash="SHA1", encoder="Hex")
 Compute a hash for the content of the given file.
 
 createExtraTestCaseResult (testCaseName, package, author, duration, maintainer=None, file=None, line=None, comment=None, showTestFunctionSortingLiterals=False)
 Creates an ExtraTestCaseResult object.
 
 addExtraTestCaseResult (extraTestCaseResult)
 Adds an ExtraTestCaseResult object.
 
 pushEnvironment ()
 Pushes the current environment dictionary on a stack, so that modifications can be applied and be popped again later.
 
 popEnvironment ()
 Pops the last pushed environment dictionary from a stack and makes it the current one.
 
 pushEnvironmentDecorator (func)
 
 EnableHighPrecisionLoggingTimeStampsDecorator (func)
 
 createHtmlDiff (fromLines, toLines, showOnlyContextOfDiff=False, numberOfContextLines=10)
 
 disableTestFunctionIf (condition)
 
 hardwareSupportsOffscreenRendering ()
 
 runProcess (command, wait=True, expectSuccess=True, expectFailure=False, verbose=True, env=None)
 
 verifyProcessResult (command, shortCommand, returncode, stdout, stderr, expectSuccess=True, expectFailure=False, verbose=True)
 
 runPythonScript (script, arguments, wait=True, expectSuccess=True, expectFailure=False, verbose=True, env=None)
 

Variables

 gEncodingRegExp = re.compile("^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)")
 
dict gEncodingCache = {}
 

Detailed Description

Basic support functions.

Function Documentation

◆ addExtraTestCaseResult()

TestSupport.Base.addExtraTestCaseResult ( extraTestCaseResult)

Adds an ExtraTestCaseResult object.

See createExtraTestCaseResult().

Parameters
extraTestCaseResultA ExtraTestCaseResult object.

Definition at line 764 of file Base.py.

References TestSupport.Base.addExtraTestCaseResult().

Referenced by TestSupport.Base.addExtraTestCaseResult().

◆ clearEncodingCache()

TestSupport.Base.clearEncodingCache ( )

Definition at line 39 of file Base.py.

Referenced by TestCenterAdvanced.Slave.Slave.unloadTestCase().

◆ compareEqual()

TestSupport.Base.compareEqual ( a,
b,
comment = "",
logOnSuccess = None )

Compare the two given values for equality.

If the two values are unequal an error is logged.

Parameters
aThe first value.
bThe second value.
commentOptional comment shown if comparison fails.
logOnSuccessPrint message in case of success.
Returns
True if values are equal.

Definition at line 196 of file Base.py.

References TestSupport.Base.escapedUnicode(), and TestSupport.Base.shouldLogOnSuccess().

◆ compareFloatEqual()

TestSupport.Base.compareFloatEqual ( a,
b,
comment = "",
epsilon = 0.0001,
logOnSuccess = None )

Compare the two given float values if they are epsilon-equal.

Parameters
aThe first value.
bThe second value.
commentComment shown if comparison fails.
epsilonEpsilon used for float comparison.
logOnSuccesPrint message in case of success.
Returns
True if values are equal.

Definition at line 253 of file Base.py.

References TestSupport.Base.shouldLogOnSuccess().

◆ compareFloatLessThan()

TestSupport.Base.compareFloatLessThan ( a,
b,
comment = "",
logOnSuccess = None )

Compare the two given float values if the first is less than the second.

Parameters
aThe first value.
bThe second value.
commentComment shown if comparison fails.
logOnSuccesPrint message in case of success.
Returns
True if first value is less than the second.

Definition at line 280 of file Base.py.

References TestSupport.Base.shouldLogOnSuccess().

◆ compareFloatLessThanOrEqual()

TestSupport.Base.compareFloatLessThanOrEqual ( a,
b,
comment = "",
epsilon = 0.0001,
logOnSuccess = None )

Compare the two given float values if the first is less than or equal to the second.

Parameters
aThe first value.
bThe second value.
commentComment shown if comparison fails.
epsilonEpsilon used for float comparison.
logOnSuccesPrint message in case of success.
Returns
True if first value is less than or equal to the second.

Definition at line 295 of file Base.py.

References TestSupport.Base.shouldLogOnSuccess().

◆ compareFloatNotEqual()

TestSupport.Base.compareFloatNotEqual ( a,
b,
comment = "",
epsilon = 0.0001,
logOnSuccess = None )

Compare the two given float values if they are epsilon-unequal.

Parameters
aThe first value.
bThe second value.
commentComment shown if comparison fails.
epsilonEpsilon used for float comparison.
logOnSuccesPrint message in case of success.
Returns
True if values are unequal.

Definition at line 267 of file Base.py.

References TestSupport.Base.shouldLogOnSuccess().

◆ compareLessThan()

TestSupport.Base.compareLessThan ( a,
b,
comment = "",
logOnSuccess = None )

Compare the two given values if the first one is less than the second.

Parameters
aThe first value.
bThe second value.
commentOptional comment shown if comparison fails.
logOnSuccessPrint message in case of success.
Returns
True if the first value is less than the second.

Definition at line 227 of file Base.py.

References TestSupport.Base.escapedUnicode(), and TestSupport.Base.shouldLogOnSuccess().

◆ compareLessThanOrEqual()

TestSupport.Base.compareLessThanOrEqual ( a,
b,
comment = "",
logOnSuccess = None )

Compare the two given values if the first one is less than or equal to the second.

Parameters
aThe first value.
bThe second value.
commentOptional comment shown if comparison fails.
logOnSuccessPrint message in case of success.
Returns
True if the first value less than or equal to the second.

Definition at line 240 of file Base.py.

References TestSupport.Base.escapedUnicode(), and TestSupport.Base.shouldLogOnSuccess().

◆ compareNotEqual()

TestSupport.Base.compareNotEqual ( a,
b,
comment = "",
logOnSuccess = None )

Compare the two given values for inequality.

If the two values are equal an error is logged.

Parameters
aThe first value.
bThe second value.
commentOptional comment shown if comparison fails.
logOnSuccessPrint message in case of success.
Returns
True if the values are unequal.

Definition at line 212 of file Base.py.

References TestSupport.Base.escapedUnicode(), and TestSupport.Base.shouldLogOnSuccess().

◆ createExtraTestCaseResult()

TestSupport.Base.createExtraTestCaseResult ( testCaseName,
package,
author,
duration,
maintainer = None,
file = None,
line = None,
comment = None,
showTestFunctionSortingLiterals = False )

Creates an ExtraTestCaseResult object.

The extra test case results enable test cases to provide additional results as a test case. For example, this is used for web tests, where the web application generates an xml report.

Parameters
testCaseNameThe name of the test case.
packageThe MeVisLab package of the test case.
authorThe author of the test case.
maintainerThe current maintainer of the test case.
Returns
The ExtraTestCaseResult object.

Definition at line 755 of file Base.py.

◆ createHtmlDiff()

TestSupport.Base.createHtmlDiff ( fromLines,
toLines,
showOnlyContextOfDiff = False,
numberOfContextLines = 10 )

Definition at line 866 of file Base.py.

◆ decodeSourceCodeLine()

TestSupport.Base.decodeSourceCodeLine ( filename,
line )

Definition at line 65 of file Base.py.

References TestSupport.Base.getSourceFileEncoding().

Referenced by TestSupport.Base.LoggingDecorator().

◆ disableTestFunctionIf()

TestSupport.Base.disableTestFunctionIf ( condition)

Definition at line 874 of file Base.py.

◆ EnableHighPrecisionLoggingTimeStampsDecorator()

TestSupport.Base.EnableHighPrecisionLoggingTimeStampsDecorator ( func)

Definition at line 801 of file Base.py.

◆ escapedUnicode()

TestSupport.Base.escapedUnicode ( value)
 Returns a unicode representation of value. If value is of type bytes then non-ASCII characters
    are escaped and a representation of the string is returned.
    For example, the 8-bit literal b'\x01' becomes 'u"\x01"'.

Definition at line 177 of file Base.py.

Referenced by TestSupport.Base.compareEqual(), TestSupport.Base.compareLessThan(), TestSupport.Base.compareLessThanOrEqual(), TestSupport.Base.compareNotEqual(), and TestSupport.Base.verifyTrue().

◆ existsFileInDataDirectory()

TestSupport.Base.existsFileInDataDirectory ( filename)

Checks if the given file exists in the data directory.

Returns
True if the file exists in the data directory, False otherwise.

Definition at line 664 of file Base.py.

References TestSupport.Base.getFileInDataDirectory().

◆ expectError()

TestSupport.Base.expectError ( function,
args = [],
kargs = {},
errorRegExp = None,
preventReplacingMessageSeverity = False )

Call the given function with the given parameters and expect an error.

Please note that nesting the expect{Warning, Error} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
errorRegExpOptional RegexObject to control which errors are handled. (Strings will be assumed to be regular expressions and compiled automatically.)
preventReplacingMessageSeverityIf True, then the error state of the diagnosis console is not cleared. The test case must call MLAB.priv().clearLogState() itself in order to prevent it from failing. Default is False.
Returns
Return value of the called function.

Definition at line 342 of file Base.py.

◆ expectInfo()

TestSupport.Base.expectInfo ( function,
args = [],
kargs = {},
infoRegExp = None,
allowUnexpectedMessages = True )

Call the given function with the given parameters and expect an info message.

Please note that nesting the expect{Warning, Error, Info} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
infoRegExpOptional RegexObject to control which info messages are expected.
allowUnexpectedMessagesOptional flag to specify if unexpected messages are allowed.
Returns
Return value of the called function.

Definition at line 526 of file Base.py.

◆ expectWarning()

TestSupport.Base.expectWarning ( function,
args = [],
kargs = {},
warningRegExp = None )

Call the given function with the given parameters and expect a warning.

Please note that nesting the expect{Warning, Error, Info} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
warningRegExpOptional RegexObject to control which warnings are handled. (Strings will be assumed to be regular expressions and compiled automatically.)
Returns
Return value of the called function.

Definition at line 367 of file Base.py.

◆ expectWarningAndError()

TestSupport.Base.expectWarningAndError ( function,
args = [],
kargs = {},
errorRegExp = None,
warningRegExp = None )

Call the given function with the given parameters and expect both a warning and an error.

Please note that nesting the expect{Warning, Error, Info} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
errorRegExpOptional RegexObject to control which errors are handled.
warningRegExpOptional RegexObject to control which warnings are handled.
Returns
Return value of the called function.

Definition at line 392 of file Base.py.

◆ getDataDirectory()

TestSupport.Base.getDataDirectory ( )

Method to return path to the data files.

Sometimes data is required for test case that should not reside inside the repository. This is where the dataDirectory option in the test case definition comes into play. This is the value that can be changed using this tag. The default is /Data.

Returns
The path to the directory where required data lives.

Definition at line 650 of file Base.py.

◆ getExternalDataDirectory()

TestSupport.Base.getExternalDataDirectory ( name,
subDirectory = None )

Method to return path to the external data directory.

Sometimes test cases require large data that should not be added to the version control. The external data directories provide a solution for such situations. If the subDirectory parameter is not given the same folder structure is used like in the calling test case. If the data directory does not exist None is returned. @params name The name of the external data directory (FME or MMS for example). @params subDirectory The sub directory in the external data store.

Returns
The path to the directory where required data lives.

Definition at line 678 of file Base.py.

◆ getFileInDataDirectory()

TestSupport.Base.getFileInDataDirectory ( filename)

Returns the absolute filename of a file in the data directory using getDataDirectory().

Returns
The absolute filename of a file in the data directory.

Definition at line 657 of file Base.py.

Referenced by TestSupport.Base.existsFileInDataDirectory().

◆ getHash()

TestSupport.Base.getHash ( filename,
hash = "SHA1",
encoder = "Hex" )

Compute a hash for the content of the given file.

The hash is computed using the ImageHash module for images and using python's hashlib for other files.

Parameters
filenameThe file that should be hashed.
hashThe hash algorithm to use.
encoderThe encoder to use.
Returns
The computed hash or None in case of failure.

Definition at line 724 of file Base.py.

◆ getModuleName()

TestSupport.Base.getModuleName ( )

Return the name of the currently tested module.

If the current test case is not a generic one None is returned.

Returns
The name of currently tested module.

Definition at line 98 of file Base.py.

References TestSupport.Base.getModuleName().

Referenced by TestSupport.Base.getModuleName().

◆ getPackageList()

TestSupport.Base.getPackageList ( )

Returns the list of available packages.

The list of packages that is said to be thought of being available. This is for example helpful if a developer having installed all the source, but wants to verify only modules are used in seeAlso that are available in public installers.

Returns
List of packages that should be thought available.

Definition at line 81 of file Base.py.

References TestSupport.Base.getPackageList().

Referenced by TestSupport.Base.getPackageList().

◆ getResultDirectory()

TestSupport.Base.getResultDirectory ( )

Getter for the directory used to save results.

All results should be collected in the given directory such that the generated data will be cleaned up when appropriate.

Returns
Path to the result directory.

Definition at line 639 of file Base.py.

◆ getSourceFileEncoding()

TestSupport.Base.getSourceFileEncoding ( filename)

Definition at line 43 of file Base.py.

Referenced by TestSupport.Base.decodeSourceCodeLine().

◆ getTestCaseContext()

TestSupport.Base.getTestCaseContext ( )

Get the context of the test.

The context in which the current test is loaded. This is where the test related network is available.

Returns
The current test case's context.

Definition at line 90 of file Base.py.

◆ getTestFunctionName()

TestSupport.Base.getTestFunctionName ( )

Returns the name of the current test function.

Returns
The name of current test function.

Definition at line 104 of file Base.py.

◆ hardwareSupportsOffscreenRendering()

TestSupport.Base.hardwareSupportsOffscreenRendering ( )

Definition at line 887 of file Base.py.

◆ hasError()

TestSupport.Base.hasError ( errorRegExp = None)
Expect that the expression in the context logs an error that matches `errorRegExp`.
If `errorRegExp` is not given, any error is expected.

Usage:
with hasError():
    doStuff()

Definition at line 580 of file Base.py.

◆ hasInfo()

TestSupport.Base.hasInfo ( infoRegExp = None,
allowUnexpectedMessages = True )
Expect that the expression in the context logs an info entry that matches `infoRegExp`.
If `infoRegExp` is not given, any info message is expected.
If `allowUnexpectedMessages` is set to True (the default), messages that do not match `infoRegExp` are ignored,
otherwise they are considered a failure.

Usage:
with hasInfo(infoRegExp=".*Unknown module.*"):
    doStuff()

Definition at line 616 of file Base.py.

◆ hasNoWarning()

TestSupport.Base.hasNoWarning ( warningRegExp = None)
Expect that the expression in the context block issues no warning that matches `warningRegExp`.
If `warningRegExp` is not given, no warning is expected at all.

Usage:
with hasNoWarning():
    doStuff()

Definition at line 546 of file Base.py.

◆ hasWarning()

TestSupport.Base.hasWarning ( warningRegExp = None)
Expect that the expression in the context block logs a warning that matches `warningRegExp`.
If `warningRegExp` is not given, any warning is expected.

Usage:
with hasWarning():
    doStuff()

Definition at line 563 of file Base.py.

◆ hasWarningAndError()

TestSupport.Base.hasWarningAndError ( errorRegExp = None,
warningRegExp = None )
Expect that the expression in the context logs errors and warnings.
See `hasError` and `hasWarning` for the arguments.

Usage:
with hasWarningAndError():
    doStuff()

Definition at line 597 of file Base.py.

◆ ignoreError()

TestSupport.Base.ignoreError ( function,
args = (),
kargs = None,
errorRegExp = None,
resultInfoDict = None )

Call the given function with the given parameters and ignores potential errors.

USE WITH CARE, usually you want to use expectError for explicit error handling!

Please note that nesting the ignore{Warning, Error} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
errorRegExpOptional RegexObject to control which errors are ignored (non-matching ones will not be caught!). (Strings will be assumed to be regular expressions and compiled automatically.)
resultInfoDictOptional dictionary that, if provided, gets a new key 'hadIgnoredErrors' with a boolean value \ that allows the caller to react on whether there acually were errors or not
Returns
Return value of the called function.

Definition at line 422 of file Base.py.

◆ ignoreWarning()

TestSupport.Base.ignoreWarning ( function,
args = (),
kargs = None,
warningRegExp = None,
resultInfoDict = None )

Call the given function with the given parameters and ignores potential warnings.

USE WITH CARE, usually you want to use expectWarning for explicit warning handling!

Please note that nesting the ignore{Warning, Warning} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
warningRegExpOptional RegexObject to control which warnings are ignored (non-matching ones will not be caught!). (Strings will be assumed to be regular expressions and compiled automatically.)
resultInfoDictOptional dictionary that, if provided, gets a new key 'hadIgnoredWarnings' with a boolean value \ that allows the caller to react on whether there acually were warnings or not
Returns
Return value of the called function.

Definition at line 459 of file Base.py.

◆ ignoreWarningAndError()

TestSupport.Base.ignoreWarningAndError ( function,
args = [],
kargs = {},
errorRegExp = None,
warningRegExp = None,
resultInfoDict = None )

Call the given function with the given parameters and ignore both a warning and an error.

USE WITH CARE, usually you want to use expectWarningAndError for explicit warning handling!

Please note that nesting the ignore{Warning, Error, Info} methods will lead to invalid line numbers in the reports!

Parameters
functionThe function to be called.
argsList of parameters for the function.
kargsDictionary of named parameters for the function.
errorRegExpOptional RegexObject to control which errors are handled.
warningRegExpOptional RegexObject to control which warnings are handled.
resultInfoDictOptional dictionary that, if provided, gets new keys 'hadIgnoredWarnings' and 'hadIgnoredErrors' \ with boolean values that allow the caller to react on whether there acually were warnings/errors or not
Returns
Return value of the called function.

Definition at line 495 of file Base.py.

◆ LoggingDecorator()

TestSupport.Base.LoggingDecorator ( func)

Internal decorator used for creating messages in compare methods.

Definition at line 159 of file Base.py.

References TestSupport.Base.decodeSourceCodeLine().

◆ popChangeSet()

TestSupport.Base.popChangeSet ( )

Pop the last ChangeSet from the stack.

At least two ChangeSets (the global one and the one for the function) must remain on the stack as they are not in the control of the user.

Definition at line 707 of file Base.py.

References TestSupport.Base.popChangeSet().

Referenced by TestSupport.Base.popChangeSet().

◆ popEnvironment()

TestSupport.Base.popEnvironment ( )

Pops the last pushed environment dictionary from a stack and makes it the current one.

See pushEnvironment().

Returns
Returns if there was an environment dictionary to pop.

Definition at line 782 of file Base.py.

References TestSupport.Base.popEnvironment().

Referenced by TestSupport.Base.popEnvironment(), and TestSupport.Base.pushEnvironmentDecorator().

◆ pushChangeSet()

TestSupport.Base.pushChangeSet ( )

Push a new ChangeSet to the stack.

Definition at line 699 of file Base.py.

References TestSupport.Base.pushChangeSet().

Referenced by TestSupport.Base.pushChangeSet().

◆ pushEnvironment()

TestSupport.Base.pushEnvironment ( )

Pushes the current environment dictionary on a stack, so that modifications can be applied and be popped again later.

See popEnvironment().

Definition at line 773 of file Base.py.

References TestSupport.Base.pushEnvironment().

Referenced by TestSupport.Base.pushEnvironment(), and TestSupport.Base.pushEnvironmentDecorator().

◆ pushEnvironmentDecorator()

TestSupport.Base.pushEnvironmentDecorator ( func)

◆ runProcess()

TestSupport.Base.runProcess ( command,
wait = True,
expectSuccess = True,
expectFailure = False,
verbose = True,
env = None )

Definition at line 905 of file Base.py.

References TestSupport.Base.verifyProcessResult().

Referenced by TestSupport.Base.runPythonScript().

◆ runPythonScript()

TestSupport.Base.runPythonScript ( script,
arguments,
wait = True,
expectSuccess = True,
expectFailure = False,
verbose = True,
env = None )

Definition at line 979 of file Base.py.

References TestSupport.Base.runProcess().

◆ setMacrosShouldLogOnSuccess()

TestSupport.Base.setMacrosShouldLogOnSuccess ( logOnSuccess)

Globally enables or disables if the ASSERT_*/EXPECT_* macros log an info message on success.

It does not have to be reset, because the TestCenter enables it before each TestCase.

For example:

def setUpTestCase():
setMacrosShouldLogOnSuccess(False)

Definition at line 125 of file Base.py.

Referenced by TestSupport.Base.MacrosShouldLogOnSuccessDecorator.__call__().

◆ shouldLogOnSuccess()

◆ verifyFalse()

TestSupport.Base.verifyFalse ( expr,
comment = "",
logOnSuccess = None,
msg = None )

If the given expression evaluates to True, an error is logged.

Parameters
exprThe expression that must evaluate to False.
commentOptional comment shown if expression is True.
logOnSuccesPrint message in case of success.
Returns
True if expression evaluates to False.

Definition at line 321 of file Base.py.

References TestSupport.Base.shouldLogOnSuccess().

◆ verifyProcessResult()

TestSupport.Base.verifyProcessResult ( command,
shortCommand,
returncode,
stdout,
stderr,
expectSuccess = True,
expectFailure = False,
verbose = True )

Definition at line 942 of file Base.py.

Referenced by TestSupport.Base.runProcess().

◆ verifyTrue()

TestSupport.Base.verifyTrue ( expr,
comment = "",
logOnSuccess = None,
msg = None )

If the given expression evaluates to False, an error is logged.

Parameters
exprThe expression that must evaluate to True.
commentOptional comment shown if expression is not True.
logOnSuccesPrint message in case of success.
Returns
True if expression evaluates to True.

Definition at line 307 of file Base.py.

References TestSupport.Base.escapedUnicode(), and TestSupport.Base.shouldLogOnSuccess().

Variable Documentation

◆ gEncodingCache

dict TestSupport.Base.gEncodingCache = {}

Definition at line 37 of file Base.py.

◆ gEncodingRegExp

TestSupport.Base.gEncodingRegExp = re.compile("^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)")

Definition at line 36 of file Base.py.