summaryrefslogtreecommitdiffhomepage
path: root/tests/test_transport.py
diff options
context:
space:
mode:
authorScott Maxwell <scott@codecobblers.com>2013-10-30 17:09:34 -0700
committerScott Maxwell <scott@codecobblers.com>2013-10-30 17:09:34 -0700
commit0e4ce3762a5b25c5d3eb89335495d3bb9054e3e7 (patch)
treea77bfec4e3a29e9827d4e75de932e34947536181 /tests/test_transport.py
parent339d73cc13765bea4dd5b683ca14b02c9baa589f (diff)
Fix message sending
Create constants for byte messages, implement asbytes so many methods can take Message and key objects directly and split get_string into get_text and get_binary. Also, change int handling to use mpint with a flag whenever the int is greater than 32 bits.
Diffstat (limited to 'tests/test_transport.py')
-rw-r--r--tests/test_transport.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_transport.py b/tests/test_transport.py
index d8cd10d5..6c62b3e3 100644
--- a/tests/test_transport.py
+++ b/tests/test_transport.py
@@ -121,8 +121,8 @@ class TransportTest(ParamikoTest):
self.sockc.close()
def setup_test_server(self, client_options=None, server_options=None):
- public_host_key = RSAKey(data=str(host_key))
host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = RSAKey(data=host_key.asbytes())
self.ts.add_server_key(host_key)
if client_options is not None:
@@ -171,8 +171,8 @@ class TransportTest(ParamikoTest):
loopback sockets. this is hardly "simple" but it's simpler than the
later tests. :)
"""
- public_host_key = RSAKey(data=str(host_key))
host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = RSAKey(data=host_key.asbytes())
self.ts.add_server_key(host_key)
event = threading.Event()
server = NullServer()
@@ -196,8 +196,8 @@ class TransportTest(ParamikoTest):
"""
verify that a long banner doesn't mess up the handshake.
"""
- public_host_key = RSAKey(data=str(host_key))
host_key = RSAKey.from_private_key_file(test_path('test_rsa.key'))
+ public_host_key = RSAKey(data=host_key.asbytes())
self.ts.add_server_key(host_key)
event = threading.Event()
server = NullServer()
@@ -708,7 +708,7 @@ class TransportTest(ParamikoTest):
# Simulate in-transit MSG_CHANNEL_WINDOW_ADJUST by sending it
# before responding to the incoming MSG_KEXINIT.
m2 = Message()
- m2.add_byte(chr(MSG_CHANNEL_WINDOW_ADJUST))
+ m2.add_byte(cMSG_CHANNEL_WINDOW_ADJUST)
m2.add_int(chan.remote_chanid)
m2.add_int(1) # bytes to add
self._send_message(m2)