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

Re: [tor-bugs] #11141 [Tor Weather]: Create unit-tests for weather components



#11141: Create unit-tests for weather components
-----------------------------+-----------------------------
     Reporter:  baumanno     |      Owner:
         Type:  task         |     Status:  new
     Priority:  normal       |  Milestone:
    Component:  Tor Weather  |    Version:
   Resolution:               |   Keywords:  weather-rewrite
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+-----------------------------

Comment (by karsten):

 I ''think'' that unit tests are wrong here.  If you grep for "grace_pd" in
 tests.py, you'll find:

 {{{
                                           'node_down_grace_pd' : '',
         self.assertEqual(node_down_sub.grace_pd, 1)
                                           'node_down_grace_pd' : '',
                                           'node_down_grace_pd' : '',
                                           'node_down_grace_pd' : 1,
                                           'node_down_grace_pd' : '',
         self.assertEqual(node_down_sub.grace_pd, 1)
                                           'node_down_grace_pd' : '',
 }}}

 It seems we're setting the node-down grace period to the empty string in
 most cases, but just once to 1 (hour).  But we're asserting that it's 1
 hour in different unit tests than the one where we're setting it to 1.
 I'd say let's remove those two asserts, or change them to 0.  And we might
 want to move one such assert to the unit test where we're actually setting
 a node-down grace period.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11141#comment:2>
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