Re: [tor-dev] Stem code review 2012-12-04

2012-12-07 Thread Damian Johnson
Hi Sean. Thanks for code reviewing my recent commits! > 1) I do not like the new _get_event() with assert_class and assert_content. > There are transformations and tests and returned values all within what is a > mock object builder, meaning it works via side-effect. This could be > surprisin

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 code review 2012-12-04

2012-12-07 Thread Sean Robinson
Stem devs, I did a code review of recent Stem commits ("Tor event handling" merge (commit 42872dd08e81d6b3) through "Checking for None by identity" (commit 69f72efc9367092c)). My comments and questions follow. I will skip my own contributions (they were great 8-) in that range, as I am biased.

[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

Re: [tor-dev] R: Re: questions about extending circuit

2012-12-07 Thread Sean Robinson
Hi, I see both Ravi and Damian have contributed fixes to extend_circuit in the last few days, including better examples. Please try your test with the latest version in the repository . Let us know whether this works for you. On Tue, Dec 4, 2012 at 7:21