Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions | Static Private Attributes
kss.core.tests.ecmaview.EcmaView Class Reference
Inheritance diagram for kss.core.tests.ecmaview.EcmaView:
Inheritance graph
Collaboration diagram for kss.core.tests.ecmaview.EcmaView:
Collaboration graph

List of all members.

Public Member Functions

def publishTraverse
def browserDefault
def __getitem__
def get
def __call__

Private Member Functions

def _runner_proxy

Static Private Attributes

tuple _testdir = absolute_dir('../kukit/tests')
tuple _runner = ViewPageTemplateFile('../kukit/tests/runner.html')

Detailed Description

Kukit test view

This allows the runner.html to be used on this view.

This provides the tests run with the compiled kukit.js
resource, in the same way as they would be run 
in production with kss.

Definition at line 73 of file

Member Function Documentation

Definition at line 140 of file

00141     def __call__(self):
00142         'By default we redirect to runner.html.'
00143         # on Zope3, the url is of zope.publisher.http.URLGetter class, so we must stringify it
00144         return self.request.response.redirect(str(self.request.URL) + '/runner.html')

Here is the caller graph for this function:

Definition at line 103 of file

00104     def __getitem__(self, name):
00105         res = self.get(name, None)
00106         if res is None:
00107             raise KeyError(name)
00108         return res

Here is the call graph for this function:

Here is the caller graph for this function:

def kss.core.tests.ecmaview.EcmaView._runner_proxy (   self,
) [private]

Definition at line 91 of file

00092     def _runner_proxy(self, *arg, **kw):
00093         'Publishable method'
00094         return self._runner(*arg, **kw)

Here is the caller graph for this function:

def kss.core.tests.ecmaview.EcmaView.browserDefault (   self,
See interface IBrowserPublisher

Definition at line 99 of file

00100     def browserDefault(self, request):
00101         '''See interface IBrowserPublisher'''
00102         return self, ()

def kss.core.tests.ecmaview.EcmaView.get (   self,
  default = _marker 

Definition at line 109 of file

00110     def get(self, name, default=_marker):
00111         # runner.html is compiled as a pagetemplate
00112         if name == 'runner.html':
00113             # XXX For Zope2.9 we need this.
00114             if not hasattr(self.request, 'debug'):
00115                 self.request.debug = None
00116             # proxy is used to make it publishable, on Zope <= 2.9
00117             return self._runner_proxy
00119         # We store them on the view on demand.
00120         # Is it there yet?
00121         if name[0] != '_':
00122             try:
00123                 return getattr(self, name)
00124             except AttributeError:
00125                 pass
00127         # See the file we need
00128         path = os.path.join(self._testdir, name)
00129         if os.path.isfile(path):
00130             # Ok, this is a file. Cook it.
00131             resource = ViewFile(name, path)
00132             setattr(self.__class__, name, resource)
00133             # important: return accessed *from* the view.
00134             return getattr(self, name)
00136         # Not found.
00137         if default is _marker:
00138             raise NotFound(None, name)
00139         return default

Here is the call graph for this function:

def kss.core.tests.ecmaview.EcmaView.publishTraverse (   self,
See interface IBrowserPublisher

Definition at line 95 of file

00096     def publishTraverse(self, request, name):
00097         '''See interface IBrowserPublisher'''
00098         return self.get(name)

Here is the call graph for this function:

Member Data Documentation

tuple kss.core.tests.ecmaview.EcmaView._runner = ViewPageTemplateFile('../kukit/tests/runner.html') [static, private]

Definition at line 87 of file

tuple kss.core.tests.ecmaview.EcmaView._testdir = absolute_dir('../kukit/tests') [static, private]

Definition at line 85 of file

The documentation for this class was generated from the following file: