diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2023-01-16 18:53:26 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2023-01-16 18:53:26 -0500 |
commit | 078c4b0fd7753f31e2f9c0c37979920a5df33098 (patch) | |
tree | 7502028ca95672109de7e9f6ceab46da2306fcca /tests | |
parent | c71ec2f96e7a56df3c40cb7f9a7ed99cd53eb678 (diff) | |
download | paramiko-078c4b0fd7753f31e2f9c0c37979920a5df33098.tar.gz |
Twiddle a test to not shadow hex builtin (and nuke %)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index 1869a7bb..5d5727bc 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -87,12 +87,12 @@ class UtilTest(unittest.TestCase): assert name in paramiko.__all__ def test_generate_key_bytes(self): - x = paramiko.util.generate_key_bytes( + key_bytes = paramiko.util.generate_key_bytes( sha1, b"ABCDEFGH", "This is my secret passphrase.", 64 ) - hex = "".join(["%02x" % byte_ord(c) for c in x]) + hexy = "".join([f"{byte:02x}" for byte in key_bytes]) hexpected = "9110e2f6793b69363e58173e9436b13a5a4b339005741d5c680e505f57d871347b4239f14fb5c46e857d5e100424873ba849ac699cea98d729e57b3e84378e8b" # noqa - assert hex == hexpected + assert hexy == hexpected def test_host_keys(self): with open("hostfile.temp", "w") as f: |