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

[tor-bugs] #29352 [Core Tor/Stem]: AttributeError when running bandwidth_file.py test



#29352: AttributeError when running bandwidth_file.py test
-------------------------------+--------------------
     Reporter:  juga           |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 Running `pytest test/unit/descriptor/bandwidth_file.py` both in Python 2.7
 and 3.5

 {{{
 test/unit/descriptor/bandwidth_file.py .....FF..
 [100%]

 ====================================================================
 FAILURES
 ====================================================================
 ______________________________________________________
 TestBandwidthFile.test_header_for_v1
 ______________________________________________________

 self = <test.unit.descriptor.bandwidth_file.TestBandwidthFile
 testMethod=test_header_for_v1>

     def test_header_for_v1(self):
       """
         Document version 1.0 predates headers, and as such should be
 prohibited.
         """

 >     self.assertRaisesWith(ValueError, 'Headers require BandwidthFile
 version 1.1 or later', BandwidthFile.create, {'new_header': 'neat stuff'})
 E     AttributeError: 'TestBandwidthFile' object has no attribute
 'assertRaisesWith'

 test/unit/descriptor/bandwidth_file.py:181: AttributeError
 ____________________________________________________
 TestBandwidthFile.test_invalid_timestamp
 ____________________________________________________

 self = <test.unit.descriptor.bandwidth_file.TestBandwidthFile
 testMethod=test_invalid_timestamp>

     def test_invalid_timestamp(self):
       """
         Invalid timestamp values.
         """

       test_values = (
         b'',
         b'boo',
         b'123.4',
         b'-123',
       )

       for value in test_values:
         expected_exc = "First line should be a unix timestamp, but was
 '%s'" % value
 >       self.assertRaisesWith(ValueError, expected_exc,
 BandwidthFile.create, {'timestamp': value})
 E       AttributeError: 'TestBandwidthFile' object has no attribute
 'assertRaisesWith'

 test/unit/descriptor/bandwidth_file.py:209: AttributeError
 ======================================================= 2 failed, 7 passed
 in 0.11 seconds =======================================================
 }}}

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