From d5d654407fdfea3af4edd23c1bd95a95815872c0 Mon Sep 17 00:00:00 2001 From: Sheng Date: Wed, 9 Oct 2019 11:46:47 +0800 Subject: [PATCH] Refactoring --- tests/sshserver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/sshserver.py b/tests/sshserver.py index 490df9e..de4deae 100644 --- a/tests/sshserver.py +++ b/tests/sshserver.py @@ -65,9 +65,10 @@ class Server(paramiko.ServerInterface): self.key_verified = False def get_cmd2enc(self, encodings): - while len(encodings) < len(self.commands): + n = len(self.commands) + while len(encodings) < n: encodings.append(random.choice(self.encodings)) - return dict(zip(self.commands, encodings[0:2])) + return dict(zip(self.commands, encodings[0:n])) def check_channel_request(self, kind, chanid): if kind == 'session':