[tor-bugs] #14076 [Stem]: Fix tutorial_examples.py to not relay on correct ordering.
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sat Jan 3 00:07:46 UTC 2015
#14076: Fix tutorial_examples.py to not relay on correct ordering.
-------------------------+-------------------------------------------------
Reporter: | Owner: atagar
Foxboron | Status: new
Type: defect | Milestone:
Priority: normal | Version:
Component: Stem | Keywords: python, tests, tutorial, examples,
Resolution: | 2, 3
Actual Points: | Parent ID:
Points: |
-------------------------+-------------------------------------------------
Comment (by atagar):
> Still need to figure out how to use the correct assertCountEqual vs
assertListEqual depending on the Python version.
If it's just a matter of python versions then maybe the following?
{{{
import stem.prereq
def assert_equal_unordered(self, expected, actual):
if stem.prereq.is_python_3():
self.assertCountEqual(expected.splitlines(), actual.splitlines())
else:
self.assertListEqual(expected.splitlines(), actual.splitlines())
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14076#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list