summaryrefslogtreecommitdiffhomepage
path: root/tests/test_client.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2023-01-16 19:03:36 -0500
committerJeff Forcier <jeff@bitprophet.org>2023-01-16 19:38:17 -0500
commite993a986388b0ec44b109a03edd34937a51aa9a1 (patch)
treec7d898b9f03d4365de8f247fd5eccead08a194f8 /tests/test_client.py
parent078c4b0fd7753f31e2f9c0c37979920a5df33098 (diff)
s/%/fstrings/g
Except in one spot where it was too complicated to bother for now XD
Diffstat (limited to 'tests/test_client.py')
-rw-r--r--tests/test_client.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_client.py b/tests/test_client.py
index 3cf991e4..3ff59b87 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -202,7 +202,7 @@ class ClientTest(unittest.TestCase):
# Client setup
self.tc = SSHClient()
self.tc.get_host_keys().add(
- "[%s]:%d" % (self.addr, self.port), "ssh-rsa", public_host_key
+ f"[{self.addr}]:{self.port}", "ssh-rsa", public_host_key
)
# Actual connection
@@ -390,7 +390,7 @@ class SSHClientTest(ClientTest):
verify that SSHClient's AutoAddPolicy works.
"""
threading.Thread(target=self._run).start()
- hostname = "[%s]:%d" % (self.addr, self.port)
+ hostname = f"[{self.addr}]:{self.port}"
key_file = _support("test_ecdsa_256.key")
public_host_key = paramiko.ECDSAKey.from_private_key_file(key_file)
@@ -424,7 +424,7 @@ class SSHClientTest(ClientTest):
client = SSHClient()
assert len(client.get_host_keys()) == 0
- host_id = "[%s]:%d" % (self.addr, self.port)
+ host_id = f"[{self.addr}]:{self.port}"
client.get_host_keys().add(host_id, "ssh-rsa", public_host_key)
assert len(client.get_host_keys()) == 1
@@ -523,7 +523,7 @@ class SSHClientTest(ClientTest):
self.tc = SSHClient()
self.tc.get_host_keys().add(
- "[%s]:%d" % (self.addr, self.port), "ssh-rsa", public_host_key
+ f"[{self.addr}]:{self.port}", "ssh-rsa", public_host_key
)
# Connect with a half second banner timeout.
kwargs = dict(self.connect_kwargs, banner_timeout=0.5)
@@ -619,7 +619,7 @@ class SSHClientTest(ClientTest):
def _client_host_key_bad(self, host_key):
threading.Thread(target=self._run).start()
- hostname = "[%s]:%d" % (self.addr, self.port)
+ hostname = f"[{self.addr}]:{self.port}"
self.tc = SSHClient()
self.tc.set_missing_host_key_policy(paramiko.WarningPolicy())
@@ -635,7 +635,7 @@ class SSHClientTest(ClientTest):
def _client_host_key_good(self, ktype, kfile):
threading.Thread(target=self._run).start()
- hostname = "[%s]:%d" % (self.addr, self.port)
+ hostname = f"[{self.addr}]:{self.port}"
self.tc = SSHClient()
self.tc.set_missing_host_key_policy(paramiko.RejectPolicy())