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
Instead of using the hybrid mock, allow the user to create his/her own instance so the constructor code will run, and then wrap the object with the recorded calls.
Something in the lines of:
mock_template=forge.create_mock_template(MyClass)
mock_template.foo().and_returns(42)
forge.replay()
my_obj=MyClass(my_var=1, another_var='foo')
mock_template.wrap(my_obj)
my_obj.foo() # return 42my_obj.bar() # call the original function
The text was updated successfully, but these errors were encountered:
Instead of using the hybrid mock, allow the user to create his/her own instance so the constructor code will run, and then wrap the object with the recorded calls.
Something in the lines of:
The text was updated successfully, but these errors were encountered: