buzzfeed / caliendo

caliendo
MIT License
16 stars 5 forks source link

Provide facilities to stub out class instances/definitions #53

Open akellehe opened 10 years ago

akellehe commented 10 years ago

A piece of functionality that was put to the side a while ago is caliendo.facade.Facade.

The Facade class is intended to decorate the class passed to it's initializer. The goal is to iterate over all the methods, wrapping them with methods that will cache as they're called in the same way caliendo.patch.patch does for individual methods.

This class should be updated to use caliendo.patch.patch to decorate those methods and offer support to skip initializing state in the initializer of the target class to the extent it's possible (for example; avoid connecting to an external service).