I have a website that has been converted to use turbogears.  One of the
options I need to support is emailing a set of HTML screens.  I have
three capture functions that all follow this pattern.
-------------------------
def capture1():
    @expose(template=".templates.screen1")
    def screen1_data():
        return dict(
            block=[],
            conditions=[],
            ... fill out dictionary ...
            )
    return screen1_data()
---------------------------
Each capture function returns the HTML as rendered by the template and I
produce the email.

I was unable to figure out a way to embed the capture functions into my
test suite.  The @expose().entangle function requires a
cherrypy.response object.  testutil provides that, but I could not
figure out how to use the available test functions for this situation.

testutil.createRequest processes a URL.  testutil.call_with_response
seems to need a controller method and fails when given the screen1_data
function.

  File "/usr/lib/python2.5/site-packages/turbogears/controllers.py", line 408, 
in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
TypeError: try_call() takes at least 2 arguments (1 given)

I was hoping someone could point me in the right direction for testing
my capture functions.  

Or is there a better way to write the capture functions so that they can
be easily tested?

-- 
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to