On 4/17/07, uniblue <[EMAIL PROTECTED]> wrote:
>
> Hi, i would like to know how i can access the dictionary returned from
> a function in a controller (that acts as a url) from a turbogears unit
> test. At the moment i am building a request and calling the function
> in a unit test as follows:
>
> # create request
> req = _cphttptools.Request("127.0.0.1", 80, "localhost", "http")
> req.path = "directory/files/lsass/24751"
>
> # call the function
> res = testutil.call_with_request(cherrypy.root.directory.files, req)
>
> whatever path i enter, i get a 404 not found.
>
actually it's a bit more complicated then that but but it's already
done for you 
http://trac.turbogears.org/browser/tags/1.0.1/turbogears/testutil.py#L75

check out for some examples.

http://trac.turbogears.org/browser/tags/1.0.1/turbogears/tests/test_controllers.py#L165

if you find the expose syntax odd that's because it's using an idiom
to make it 2.3 compatible. you can use plain old @expose

--~--~---------~--~----~------------~-------~--~----~
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