diff options
author | Scott Maxwell <scott@codecobblers.com> | 2013-11-19 10:09:08 -0800 |
---|---|---|
committer | Scott Maxwell <scott@codecobblers.com> | 2013-11-19 10:09:08 -0800 |
commit | 6d75c75e643c3a109075e86e72b08221c76088cc (patch) | |
tree | 95dd49cbe6d9d194f337a8ae5310800a2f103430 /tests/test_packetizer.py | |
parent | 981f768a62402a5aaa9f9f0ddfb4e14faa0d4442 (diff) |
Remove byte conversions and unhexlify calls that we only needed for Py2.5 support and use the `b` byte string marker instead
Diffstat (limited to 'tests/test_packetizer.py')
-rw-r--r-- | tests/test_packetizer.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_packetizer.py b/tests/test_packetizer.py index 43dea38a..5c36fed6 100644 --- a/tests/test_packetizer.py +++ b/tests/test_packetizer.py @@ -21,7 +21,6 @@ Some unit tests for the ssh2 protocol in Transport. """ import unittest -from binascii import unhexlify from tests.loop import LoopSocket from Crypto.Cipher import AES from Crypto.Hash import SHA, HMAC @@ -55,7 +54,7 @@ class PacketizerTest (unittest.TestCase): data = rsock.recv(100) # 32 + 12 bytes of MAC = 44 self.assertEqual(44, len(data)) - self.assertEqual(unhexlify(b('439197bd5b50ac2587c2c46bc7e938c0')), data[:16]) + self.assertEqual(b'\x43\x91\x97\xbd\x5b\x50\xac\x25\x87\xc2\xc4\x6b\xc7\xe9\x38\xc0', data[:16]) def test_2_read (self): rsock = LoopSocket() @@ -66,7 +65,7 @@ class PacketizerTest (unittest.TestCase): p.set_hexdump(True) cipher = AES.new(zero_byte * 16, AES.MODE_CBC, x55 * 16) p.set_inbound_cipher(cipher, 16, SHA, 12, x1f * 20) - wsock.send(unhexlify(b('439197bd5b50ac2587c2c46bc7e938c090d216560d717361387c4c3dfb977de26e03b1a0c21cd641414cb459'))) + wsock.send(b'\x43\x91\x97\xbd\x5b\x50\xac\x25\x87\xc2\xc4\x6b\xc7\xe9\x38\xc0\x90\xd2\x16\x56\x0d\x71\x73\x61\x38\x7c\x4c\x3d\xfb\x97\x7d\xe2\x6e\x03\xb1\xa0\xc2\x1c\xd6\x41\x41\x4c\xb4\x59') cmd, m = p.read_message() self.assertEqual(100, cmd) self.assertEqual(100, m.get_int()) |