Wichert Akkerman escribió:
Previously Dalius Dobravolskas wrote:
Hello,
On Mon, Jan 19, 2009 at 7:44 AM, Roberto Allende ro...@menttes.com wrote:
My motivation is to write a unit testing but even in other cases it
could have sense to use a controller function isolated. Or at least in
my case, this is the only restriction.
If your intention is unit-testing do it Pylons way:
http://wiki.pylonshq.com/display/pylonsdocs/Unit+Testing
That is not unit testing, that is functional testing.
If you want to unit test your controller and run it in isolation you
need to do a bit of setup work in your test case. I use this:
Thanks a lot Wiggy, your mails were very helpful. Although, it seems
we're using different versions of Pylons (or i'm doing smt wrong)
because following your approach i also needed wsgiapp variables Buffet,
g and session at least.
Just for the record, i'm using 0.9.6.2.
By the other hand, in pylons.wsgiapp there's a method called
load_test_env wich seems to use a test environment. If we're able to use
that instead, we wouldn't be using a mock object but at least, we would
use a test environment.
I'll keep trying. Thanks again!
Kind Regards
r.
--
http://menttes.com
http://robertoallende.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---