KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to create a mock.Mock() object, then add a method called session that acts like an instance method, which is passed a self reference to the mock object, allowing the method to add state to the mock object. Is this possible (without manually using types.MethodType , e.g., using mock's built-in API), or should I just find a way around it? Note, I found this question , which is for Ruby and seems to cover something similar, if not the same thing. Unfortunately, I don't know Ruby very well at all.
Tags (comma-separated)
Save Edits
Cancel