Now it is possible to mock not only a function but also a class:
class TestClass(object)
def test_func_a(self, m):
m.register_uri('GET', 'http://test.com', text='data')
...
def test_func_b(self, m)
m.register_uri('GET', 'http://test.com', text='data')
...
This new behavior mimics behavior of `patch` from `mock` library.
Added docs for this new feature.
Closes-Bug: #1404805
Change-Id: I8303dc4bc682cf12ffe86e7712b5a1c54de83efb
This seems to have been an oversight to leave off. Proxy the call and
call_count variables so that they can be retrieved from the mocker.
Change-Id: I5abe9cb0b3870fd9f50a8834193d939268f11efa
This is the same as the Mocker() however it looks more correct to do
@requests_mock.mock() rather than @requests_mock.Mocker().
Ideally mock() would be the decorator and Mocker() the context manager
but it doesn't really matter.
This shouldn't be considered the way to use these methods, using the
strings are fine, but in certain places people don't like using strings
everywhere and so we should have the constants available for them.