[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #11335 [Stem]: Tests for example scripts



#11335: Tests for example scripts
-----------------------------+--------------------------
     Reporter:  atagar       |      Owner:  atagar
         Type:  enhancement  |     Status:  new
     Priority:  normal       |  Milestone:
    Component:  Stem         |    Version:
   Resolution:               |   Keywords:  testing easy
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+--------------------------

Comment (by atagar):

 Hi sambuddhabasu, this is a great start!

 > mocking.get_protocolinfo_response()

 What you're doing here is a hack and liable to break (... in fact, I'm a
 little surprised it runs right now). The get_protocolinfo_response()
 provides a ControlMessage like what Tor provides in reply to a
 PROTOCOLINFO request. You're essentially making the wrong type of object,
 then calling setattr() to give it an address attribute so you can use it
 like a RouterStatusEntry.

 I just gave get_protocolinfo_response() as an example, I didn't expect you
 to use it directly. Take a look at what the Controller methods return,
 then look for corresponding types in the mock module.

 Cheers! -Damian

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11335#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs