Package gavo :: Package helpers :: Module testhelpers :: Class TestResource
[frames] | no frames]

Class TestResource

source code

                       object --+    
                                |    
testresources.TestResourceManager --+
                                    |
                                   TestResource

A wrapper for testresources maintaining some backward compatibility.

testresources 2.0.1 pukes into the namespaces of what's returned from make. I've not really researched what they intend people to return from make these days, but in order to avoid major surgery on the code, this class simply wraps objects that don't allow arbitrary attributes with ResourceInstance when returned from make.

To make that happen, I need to override code from testresources itself, which is a pity. In case this breaks: Take all methods that call .make and replace make with _make_and_wrap.

Caution: when you implement reset(), you'll have to wrap the result with testhelpers.ResourceInstance manually; but then you'd have to copy dependencies manually, which is crazy, and so I think manual reset currently really is broken.

Instance Methods

Inherited from testresources.TestResourceManager: __init__, clean, dirtied, finishedWith, getResource, isDirty, make, neededResources, reset

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

Class Variables

Inherited from testresources.TestResourceManager: setUpCost, tearDownCost

Properties

Inherited from object: __class__