diff options
author | Tim Stolarski <t.stolarski@stolarski-it.de> | 2021-04-30 09:08:14 +0200 |
---|---|---|
committer | Tim Stolarski <t.stolarski@stolarski-it.de> | 2021-04-30 09:08:14 +0200 |
commit | f914e1288eb0f62537919cef6362a876e9c648b4 (patch) | |
tree | 3b8afbe1470eed50beaa295e037ee0f0f0b1a4ef | |
parent | 70696fe80e0f9131fbf5c1f529c60cbff9600151 (diff) |
Fixup readability: Add Test for get() without using prefetch
-rw-r--r-- | tests/test_sftp.py | 12 |
1 files 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): """ |