From cbbf5d0d3f30ed1393879950cf462b6033347497 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 15 Nov 2024 14:11:09 +0100 Subject: [PATCH] tests: Symetric test for upload to override existing file --- tests/unit/sftp_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/sftp_test.py b/tests/unit/sftp_test.py index 93446bd9..1822522d 100644 --- a/tests/unit/sftp_test.py +++ b/tests/unit/sftp_test.py @@ -89,6 +89,12 @@ def test_get_existing(dst_exists_path, src_path, sftp_session, transmit_payload) assert dst_exists_path.read_bytes() == transmit_payload +def test_put_existing(dst_exists_path, src_path, sftp_session, transmit_payload): + """Check that SFTP file download works when target file exists.""" + sftp_session.put(str(src_path), str(dst_exists_path)) + assert dst_exists_path.read_bytes() == transmit_payload + + @pytest.fixture def large_payload(): """Generate a large 1025 byte (1024 + 1B) test payload."""