Re: [tor-dev] stem mock_method usage

2012-12-07 Thread Damian Johnson
Hi Sean. You're using the mock_method() function correctly... class Foo: def greeting(self): return 'hi' f = Foo() print f.greeting() mocking.mock_method(Foo, 'greeting', mocking.return_value('bye')) print f.greeting() ===

[tor-dev] stem mock_method usage

2012-12-07 Thread Sean Robinson
Damian, I am attempting to write a test using test.mocking.mock_method, but I do not understand how to use it correctly. Could you give me pointers on the following smallest (non-)working test case. import stem from stem.control import Controller import test.mocking as mocking socket = stem.soc