Skip to content

Commit d58be08

Browse files
author
Dan
committed
Fix py3 tests
1 parent ed7a502 commit d58be08

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_ssh_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,16 @@ def test_openssh_config(self):
296296
_server = start_server(_listen_socket)
297297
_port = _listen_socket.getsockname()[1]
298298
_key = USER_KEY_PATH
299-
content = [bytes("""Host %s\n""" % (_host,)),
300-
bytes(""" User %s\n""" % (_user,)),
301-
bytes(""" Port %s\n""" % (_port,)),
302-
bytes(""" IdentityFile %s\n""" % (_key,)),
299+
content = [("""Host %s\n""" % (_host,)),
300+
(""" User %s\n""" % (_user,)),
301+
(""" Port %s\n""" % (_port,)),
302+
(""" IdentityFile %s\n""" % (_key,)),
303303
]
304-
config_file.writelines(content)
304+
config_file.writelines([s.encode('utf-8') for s in content])
305305
config_file.flush()
306306
host, user, port, pkey = utils.read_openssh_config(
307307
_host, config_file=config_file.name)
308+
config_file.close()
308309
self.assertEqual(host, _host)
309310
self.assertEqual(user, _user)
310311
self.assertEqual(port, _port)

0 commit comments

Comments
 (0)