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

Class FakeContext

source code

object --+
         |
        FakeContext

A scaffolding class for testing renderers.

This will in general not be enough as most actions renderers do will require a running reactor, so you need trial. But sometimes it's all synchronous and this will do.

You can simulate a simple locateChild/renderHTTP cycle with runRequest(resource, path). This will, in particular, use a renderSync method on the page(s) if available. It will hand out exceptions as usual. It will return what's written to context and returned by renderHTTP.

Instance Methods
 
__init__(self, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
runRequest(self, resource, path) source code
 
__providedBy__(...)
Object Specification Descriptor
source code
 
__provides__(...)
Special descriptor for class __provides__

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

Class Variables
  __implemented__ = <implementedBy gavo.helpers.testhelpers.Fake...
Properties

Inherited from object: __class__

Method Details

__init__(self, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__provides__(...)

 

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.


Class Variable Details

__implemented__

Value:
<implementedBy gavo.helpers.testhelpers.FakeContext>