> I've made a couple of attempts of working with the CP3 branch. I'd like to > share some of the lessons/mistakes I've made along the way.. hopefully > someone will find value in them.
This is all really good information. Thanks! > Starting with #2, the config system, it doesn't seem too difficult to hack > together support for the new CP3 approach [1]. I posted something similar > a while back, but Florent was working on a more complete re-write, so I > didn't push the issue. My hack seems to work, though, so maybe it's worth > mentioning again. Yea, Florent's always got some cool tricks up his sleeve. ;) > Regarding #1, the test infrastructure, I've tried a couple of approaches. > First, I tried creating a "Fixture Like" class that wrapped cherrypy's > response object to produce something that looked vaguely like paste.fixture. > The other question that comes up is how to get people to start doing > something besides importing cherrpy & using it's response object in their > tests. It seems to me that create_request should return a webob-like > response that should be used [3]. Should testutil monkey-patch > cherrypy.response to issue a deprecation warning to let people know they > should be switching over? well, the standard way of using webob or paste.fixture would be to wrap the whole cherrypy app, and then the resulting wsgi response will be turned into a response object by the test fixture. Couldn't we change the way testutil works to just wrap the whole TG app in a completely "framework agnostic" way for testing. If we do that we can just give back a Response object (which is a WebOb response) that has template_namespace as an attribute so that we can see what's in the returned dictionary. Testutil could be written to somewhat mimic the tg1.0 API by just grabbing the template_namespace dictionary and returning it in the proper cases. And we could issue deprication warnings and try to encourage people to just use the agnostic fixture approach. > In the push towards tg 2.0, eventually something should also be done in the > tests to abstract away mounting apps via assigning cherrpy.root, but that's > another ball of wax. True enough, but that's not so much a testing issue ;) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
