From f914e1288eb0f62537919cef6362a876e9c648b4 Mon Sep 17 00:00:00 2001 From: Tim Stolarski Date: Fri, 30 Apr 2021 09:08:14 +0200 Subject: Fixup readability: Add Test for get() without using prefetch --- tests/test_sftp.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 31a0eb2d..3a5224c9 100644 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -560,25 +560,27 @@ class TestSFTP(object): using a lager file. """ + sftp_filename = sftp.FOLDER + "/dummy_file" + num_chars = 1024 * 1024 * 4 + fd, localname = mkstemp() os.close(fd) with open(localname, 'wb') as f: - num_chars = 1024 * 1024 * 4 f.write(b'0' * num_chars) - sftp.put(localname, sftp.FOLDER + "/dummy_file") + sftp.put(localname, sftp_filename) os.unlink(localname) fd, localname = mkstemp() os.close(fd) - sftp.get(sftp.FOLDER + "/dummy_file", localname, prefetch=False) + sftp.get(sftp_filename, localname, prefetch=False) - assert os.stat(localname).st_size == 4194304 + assert os.stat(localname).st_size == num_chars os.unlink(localname) - sftp.unlink(sftp.FOLDER + "/dummy_file") + sftp.unlink(sftp_filename) def test_check(self, sftp): """ -- cgit v1.2.3