summaryrefslogtreecommitdiff
path: root/tests/test_sftp.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_sftp.py
parent078c4b0fd7753f31e2f9c0c37979920a5df33098 (diff)
downloadparamiko-e993a986388b0ec44b109a03edd34937a51aa9a1.tar.gz
s/%/fstrings/g
Except in one spot where it was too complicated to bother for now XD
Diffstat (limited to 'tests/test_sftp.py')
-rw-r--r--tests/test_sftp.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index bcda5441..5767c00b 100644
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -775,18 +775,18 @@ class TestSFTP(object):
def test_non_utf8_data(self, sftp):
"""Test write() and read() of non utf8 data"""
try:
- with sftp.open("%s/nonutf8data" % sftp.FOLDER, "w") as f:
+ with sftp.open(f"{sftp.FOLDER}/nonutf8data", "w") as f:
f.write(NON_UTF8_DATA)
- with sftp.open("%s/nonutf8data" % sftp.FOLDER, "r") as f:
+ with sftp.open(f"{sftp.FOLDER}/nonutf8data", "r") as f:
data = f.read()
assert data == NON_UTF8_DATA
- with sftp.open("%s/nonutf8data" % sftp.FOLDER, "wb") as f:
+ with sftp.open(f"{sftp.FOLDER}/nonutf8data", "wb") as f:
f.write(NON_UTF8_DATA)
- with sftp.open("%s/nonutf8data" % sftp.FOLDER, "rb") as f:
+ with sftp.open(f"{sftp.FOLDER}/nonutf8data", "rb") as f:
data = f.read()
assert data == NON_UTF8_DATA
finally:
- sftp.remove("%s/nonutf8data" % sftp.FOLDER)
+ sftp.remove(f"{sftp.FOLDER}/nonutf8data")
@requireNonAsciiLocale("LC_TIME")
def test_sftp_attributes_locale_time(self, sftp):
@@ -807,26 +807,26 @@ class TestSFTP(object):
"""Test write() using a buffer instance."""
data = 3 * b"A potentially large block of data to chunk up.\n"
try:
- with sftp.open("%s/write_buffer" % sftp.FOLDER, "wb") as f:
+ with sftp.open(f"{sftp.FOLDER}/write_buffer", "wb") as f:
for offset in range(0, len(data), 8):
f.write(buffer(data, offset, 8)) # noqa
- with sftp.open("%s/write_buffer" % sftp.FOLDER, "rb") as f:
+ with sftp.open(f"{sftp.FOLDER}/write_buffer", "rb") as f:
assert f.read() == data
finally:
- sftp.remove("%s/write_buffer" % sftp.FOLDER)
+ sftp.remove(f"{sftp.FOLDER}/write_buffer")
@needs_builtin("memoryview")
def test_write_memoryview(self, sftp):
"""Test write() using a memoryview instance."""
data = 3 * b"A potentially large block of data to chunk up.\n"
try:
- with sftp.open("%s/write_memoryview" % sftp.FOLDER, "wb") as f:
+ with sftp.open(f"{sftp.FOLDER}/write_memoryview", "wb") as f:
view = memoryview(data)
for offset in range(0, len(data), 8):
f.write(view[offset : offset + 8])
- with sftp.open("%s/write_memoryview" % sftp.FOLDER, "rb") as f:
+ with sftp.open(f"{sftp.FOLDER}/write_memoryview", "rb") as f:
assert f.read() == data
finally:
- sftp.remove("%s/write_memoryview" % sftp.FOLDER)
+ sftp.remove(f"{sftp.FOLDER}/write_memoryview")