Home | Trees | Indices | Help |
---|
|
object --+ | dict --+ | Context
Test-time and local configuration for tests. A 'Context' object contains all of the information a test needs to execute, beyond what is stored as part of the test specification itself. Information in the context can include, * Local (per-user, etc.) configuration, such as where to find the tested program. * Environmental information, such as which machine the test is running on. * One-time configuration, including test arguments specified on the command line. A 'Context' object is effectively a mapping object whose keys must be labels and values must be strings.
|
|||
new empty dictionary |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
True if D has a key k, else False |
|
||
D[k] if k in D, else d |
|
||
True if D has a key k, else False |
|
||
|
|||
list of D's (key, value) pairs, as 2-tuples |
|
||
|
|||
Inherited from Inherited from |
|
|||
TARGET_CONTEXT_PROPERTY =
The context variable giving the name of the current target. |
|||
DB_PATH_CONTEXT_PROPERTY =
The context variable giving the path to the database. |
|||
ID_CONTEXT_PROPERTY =
The context variable giving the name of the running test or resource. |
|||
TMPDIR_CONTEXT_PROPERTY =
A context property whose value is a string giving the path to a temporary directory. |
|||
__safe_for_unpickling__ = 1 Required to unpickle new-style classes under Python 2.2. |
|||
Inherited from |
|
|||
Inherited from |
|
Construct a new context. 'context' -- If not 'None', the existing 'Context' being wrapped by this new context.
|
Return the value for 'variable' in scope 'klass'. Scopes are nested with '.', and inner variables hide outer variables of the same name. Thus, looking up the value of 'a.b.c.var' will return 1 if the context contains a.b.c.var=1 but 2 if it contains a.b.d.var=1 a.b.var=2 a.var=3. 'klass' -- The variable's scope. 'variable' -- The variable name. 'default' -- Default value. |
Return the boolean value associated with 'key'. 'key' -- A string. 'default' -- A default boolean value. returns -- The value associated with 'key' in the context, interpreted as a boolean. If there is no value associated with 'key' and default is not 'None', then the boolean value associated with default is used. If there is no value associated with 'key' and default is 'None', an exception is raised. The value associated with 'key' must be a string. If not, an exception is raised. If the value is a string, but does not correspond to a boolean value, an exception is raised. |
Return the list of strings associated with 'key'. 'key' -- A string. 'default' -- A default list. If there is no value associated with 'key' and default is not 'None', then the boolean value associated with default is used. If there is no value associated with 'key' and default is 'None', an exception is raised. The value associated with 'key' must be a string. If not, an exception is raised. If the value is a string, but does not correspond to a string list, an exception is raised. |
Return the path to the a temporary directory. returns -- The path to the a temporary directory. The 'Runnable' object may make free use of this temporary directory; no other 'Runnable's will use the same directory at the same time. |
Read the context file 'file_name'. 'file_name' -- The name of the context file. Reads the context file and adds the context properties in the file to 'self'. |
|
d defaults to None.
|
|
x[y]
|
|
Return the properties added to this context by resources. returns -- A map from strings to values indicating properties that were added to this context by resources. |
|
DB_PATH_CONTEXT_PROPERTYThe context variable giving the path to the database. The value of this context variable will be a string giving the path to the database directory. For example, if QMTest is invoked as 'qmtest -D /path/to/db run', the value of this variable would be '/path/to/db'. The value may be an absolute or a relative path.
|
ID_CONTEXT_PROPERTYThe context variable giving the name of the running test or resource. This value of this context variable will be the string giving the name of the of the test or resource that is presently executing.
|
TMPDIR_CONTEXT_PROPERTYA context property whose value is a string giving the path to a temporary directory. This directory will be used only by the 'Runnable' in whose context this property occurs during the execution of that 'Runnable'. No other object will use the same temporary directory at the same time. There is no guarantee that the temporary directory is empty, however; it may contain files left behind by the execution of other 'Runnable' objects.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Dec 23 12:30:41 2011 | http://epydoc.sourceforge.net |