Reputation: 37
I need to mock two functions inside my API post method. Mocking just one function worked well, but I have no idea how to do it when i need to mock two functions?
@unittest.mock.patch('path.to.first.function.thefirstfunction')
def test_connector_post(mock_thefirstfunction):
...
Any ideas?
Upvotes: 2
Views: 173
Reputation: 18920
stack the decorators!
@unittest.mock.patch("functionA")
@unittest.mock.patch("functionB")
def test_foo(...):
...
Upvotes: 1