You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to use the functionality for configuring a mock to return specific values (using side_effect as it seems from how mock works) when called with specific parameters?
The text was updated successfully, but these errors were encountered:
AFAIK, the built-in Python mocks do not support this. You will probably need to implement such logic inside a custom function and assign it to side_effect, e.g.:
Note that such mocking is intentionally outside of scope of callee (though it could be part of a bigger library that combines callee with unittest.mock to provide some of the functionality of Java's Mockito, incl. the when-then style of mocking).
Is there a way to use the functionality for configuring a mock to return specific values (using side_effect as it seems from how mock works) when called with specific parameters?
The text was updated successfully, but these errors were encountered: