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
I looked at this open source library and want to say I really like the idea of finally having a type-hint oriented mocking library for Python so thank you! I'd like to suggest some features inspired by C# Moq library which looks very similar in design:
Add a matcher for custom predicate, e.g. even integers predicate every(function_mock).with_args(pred(lambda x: x % 2 == 0)).returns(True). In case of verifications, the error message can include the code of the predicate itself, would be very useful.
For returns add an option to return results based on a function of the input args, e.g. setup a function to return the negative of an integer: every(function_mock).returns(operator.neg) with def function_mock(param: int): pass
The text was updated successfully, but these errors were encountered:
Hi,
I looked at this open source library and want to say I really like the idea of finally having a type-hint oriented mocking library for Python so thank you! I'd like to suggest some features inspired by C# Moq library which looks very similar in design:
every(function_mock).with_args(pred(lambda x: x % 2 == 0)).returns(True)
. In case of verifications, the error message can include the code of the predicate itself, would be very useful.returns
add an option to return results based on a function of the input args, e.g. setup a function to return the negative of an integer:every(function_mock).returns(operator.neg)
withdef function_mock(param: int): pass
The text was updated successfully, but these errors were encountered: