[tor-bugs] #7499 [Stem]: Unit test bug - mocking.py:_get_descriptor_content() handlign of 'opt' keyword
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sat Nov 17 00:27:56 UTC 2012
#7499: Unit test bug - mocking.py:_get_descriptor_content() handlign of 'opt'
keyword
--------------------+-------------------------------------------------------
Reporter: eoinof | Owner: atagar
Type: defect | Status: new
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
--------------------+-------------------------------------------------------
mocking.py:_get_descriptor_content() contains several bugs
with how the opt keyword is handled.
1)
The attr arg is converted to a dictionary, so if more
than one attribute is supplied using the opt keyword it is
overwritten by the last element.
2)
Any args supplied using the keyword opt will not be matched to
the corresponding keyword in header_template. This will cause
the template be invalid.
3)
Any args supplied in attr to ovewrite values that use opt in the
header_template will not be matched. This will cause the tempalte to be
invalid.
The easiest fix for all of the above would be to not allow use of the opt
keyword with this function in the unit tests.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7499>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list