Package qm :: Package test :: Package classes :: Module temporary :: Class TempDirectoryResource
[hide private]
[frames] | no frames]

Class TempDirectoryResource

source code

         object --+            
                  |            
extension.Extension --+        
                      |        
      runnable.Runnable --+    
                          |    
          resource.Resource --+
                              |
                             TempDirectoryResource

Resource class to manage a temporary directory.

An instance of this resource creates a temporary directory during setup, and deletes it during cleanup. The full path to the directory is available to tests via a context property.

Nested Classes [hide private]

Inherited from runnable.Runnable: ResourceField

Inherited from extension.Extension: Type, __metaclass__

Instance Methods [hide private]
 
SetUp(self, context, result)
Set up the resource.
source code
 
CleanUp(self, result)
Clean up the resource.
source code

Inherited from runnable.Runnable: GetAttachments, GetDatabase, GetId, __init__

Inherited from extension.Extension: GetClassName, GetExplicitArguments, MakeDomDocument, MakeDomElement, Write, __getattr__

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

Class Variables [hide private]
  arguments = [<<class 'qm.fields.TextField'> dir_path_property>...
A list of the arguments to the extension class.
  _argument_dictionary = {'delete_recursively': <<class 'qm.fiel...
A map from argument names to 'Field' instances.
  _argument_list = [<<class 'qm.fields.TextField'> dir_path_prop...
A list of all the 'Field's in this class.
  delete_recursively = 1
  dir_path_property = 'temp_dir_path'

Inherited from resource.Resource: kind

Inherited from runnable.Runnable: EXTRA_DATABASE, EXTRA_ID, RESOURCE_FIELD_ID, resources

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

SetUp(self, context, result)

source code 

Set up the resource.

'context' -- A 'Context' giving run-time parameters to the resource. The resource may place additional variables into the 'context'; these variables will be visible to tests that depend on the resource.

'result' -- A 'Result' object. The outcome will be 'Result.PASS' when this method is called. The 'result' may be modified by this method to indicate outcomes other than 'Result.PASS' or to add annotations.

This method should not return a value.

Derived classes must override this method.

Overrides: resource.Resource.SetUp
(inherited documentation)

CleanUp(self, result)

source code 

Clean up the resource.

'result' -- A 'Result' object. The outcome will be 'Result.PASS' when this method is called. The 'result' may be modified by this method to indicate outcomes other than 'Result.PASS' or to add annotations.

This method should not return a value.

Derived classes may override this method.

Overrides: resource.Resource.CleanUp
(inherited documentation)

Class Variable Details [hide private]

arguments

A list of the arguments to the extension class.

Each element of this list should be an instance of 'Field'. The 'Field' instance describes the argument.

Derived classes may redefine this class variable. However, derived classes should not explicitly include the arguments from base classes; QMTest will automatically combine all the arguments found throughout the class hierarchy.

Value:
[<<class 'qm.fields.TextField'> dir_path_property>,
 <<class 'qm.fields.IntegerField'> delete_recursively>]

_argument_dictionary

A map from argument names to 'Field' instances.

A map from the names of arguments for this class to the corresponding 'Field'.

Value:
{'delete_recursively': <<class 'qm.fields.IntegerField'> delete_recurs\
ively>,
 'dir_path_property': <<class 'qm.fields.TextField'> dir_path_property\
>,
 'resources': <<class 'qm.fields.SetField'> resources>}

_argument_list

A list of all the 'Field's in this class.

This list combines the complete list of 'arguments'. 'Field's appear in the order reached by a pre-order breadth-first traversal of the hierarchy, starting from the most derived class.

Value:
[<<class 'qm.fields.TextField'> dir_path_property>,
 <<class 'qm.fields.SetField'> resources>,
 <<class 'qm.fields.IntegerField'> delete_recursively>]