Archive for October, 2009

For testability reasons, we’ve begun using a lot of dependency injection in our Python projects. Imagine that I have a function that does some work and then ultimately calls an API over-the-wire: import simplejson from google.appengine.api import urlfetch # App Engine example def my_method(user_id):   url = ‘http://www.example.com/lookup-user/%d.json’ % user_id   result = urlfetch.fetch(url)   if result.status_code == [...]



Follow

Get every new post delivered to your Inbox.