Package qm :: Package test :: Module resource_adapter :: Class ResourceAdapter
[show private | hide private]
[frames | no frames]

Type ResourceAdapter

object --+            
         |            
 Extension --+        
             |        
      Runnable --+    
                 |    
          Resource --+
                     |
                    ResourceAdapter


A 'ResourceAdapter' converts test classes to resource classes.

If 'C' is a test class, then a class derived from 'ResourceAdapter' and 'C' (in that order!) will be a resource class. The resource class 'Setup' method is equivalent to the 'Test' class 'Run' method. The 'CleanUp' action is empty.
Method Summary
  SetUp(self, context, result)
Set up the resource.
    Inherited from Resource
  CleanUp(self, result)
Clean up the resource.
    Inherited from Runnable
  __init__(self, arguments, **args)
Construct a new 'Runnable'.
  GetAttachments(self)
Return the 'Attachment's to this 'Runnable'.
  GetDatabase(self)
Return the 'Database' in which this test or resource is stored.
  GetId(self)
Return the name of this test or resource.
    Inherited from Extension
  __getattr__(self, name)
  GetClassName(self)
Return the name of the extension class.
  GetExplicitArguments(self)
Return the arguments to this extension instance.
  MakeDomDocument(self)
Create a DOM document for 'self'.
  MakeDomElement(self, document, element)
Create a DOM node for 'self'.
  Write(self, file)
Write an XML description of 'self' to a file.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
list resources = []
    Inherited from Resource
str kind = 'resource'
    Inherited from Runnable
list arguments = [<<class 'qm.fields.SetField'> resources>]
str EXTRA_DATABASE = 'qmtest_database'
str EXTRA_ID = 'qmtest_id'
str RESOURCE_FIELD_ID = 'resources'

Method Details

SetUp(self, context, result)

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:
qm.test.resource.Resource.SetUp (inherited documentation)

Class Variable Details

resources

Type:
list
Value:
[]                                                                     

Generated by Epydoc 2.1 on Thu Sep 27 15:49:06 2007 http://epydoc.sf.net