RSSAmplifier

Blueprint Forge. · Jan 8, 2012

Python: Injecting Mock Objects for Powerful Testing

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

The code discussed in this post can be found in the github repository . While writing a module to handle Google ClientLogin recently, I wanted to test error handling by simulating error responses from the server. A simple but powerful way of doing this is to use the patching ability of the mock module. The patching ability allows you to replace objects in scope with mocks so that different side…

Read on /blog/2012/01/08/python-injecting-mock-objects-for-powerful-testing/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.