]> git.ipfire.org Git - thirdparty/mtr.git/commit
test: Fix mtr-packet tests for Python 3
authorMatt Kimball <matt.kimball@gmail.com>
Sun, 4 Dec 2016 18:03:44 +0000 (10:03 -0800)
committerMatt Kimball <matt.kimball@gmail.com>
Sun, 4 Dec 2016 18:03:44 +0000 (10:03 -0800)
commitac58c7a4b744752958975b93d8f774572186a421
treefb7244b25926c0685a949cdd637c9aa6bf53d626
parent032d82f326d76ef1e064b5db68a2486275fa06b5
test: Fix mtr-packet tests for Python 3

The mtr-packet test suite was written to run with Python 2, and lacked
the Unicode to bytes and bytes to Unicode conversions required to
run with Python 3.  This change adds those conversions, and the result
works with either Python 2 or Python 3.

Also, close the subprocess's stdin and stdout explicitly.  Python 3's
unittest complains about unclosed file descriptors otherwise.
packet/testpacket.py [changed mode: 0755->0644]