Fluxx/exam — pull request #18 by Fluxx (2013-02-01 23:20:45+00:00)
Title: Add effect helper

Builds a callable based on a series of `(call(), return_value)` tuples passed in. i.e.

``` python
>>> from exam.objects import call, effect
>>> side_effect = effect((call(1), 'with 1'), (call(2), 'with 2'))
>>> side_effect(1)
'with 1'
>>> side_effect(2)
'with 2'
```

Useful for settings a mock `side_effect` that is deterministic based on the args, without having to write a separate function.