I am testing a function doing two times a "requests.post". Si I stub the call to this function. However, I want that the first stub return a fake data, and the second stub another fake data. How to do it ? Currently, I have :
@mock.patch('requests.post', side_effect=mocked_object)
def test_function_ok(self, mock_post):
...
And I want something like this :
@mock.patch_once('requests.post', side_effect=mocked_1)
@mock.patch_once('requests.post', side_effect=mocked_2)
def test_function_ok(self, mock_post):
...