Skip to content

Commit 9d105eb

Browse files
committed
tests: Symetric test for upload to override existing file
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 945ae7c commit 9d105eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/sftp_test.py

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def test_get_existing(dst_exists_path, src_path, sftp_session, transmit_payload)
8989
assert dst_exists_path.read_bytes() == transmit_payload
9090

9191

92+
def test_put_existing(dst_exists_path, src_path, sftp_session, transmit_payload):
93+
"""Check that SFTP file upload works when target file exists."""
94+
sftp_session.put(str(src_path), str(dst_exists_path))
95+
assert dst_exists_path.read_bytes() == transmit_payload
96+
97+
9298
@pytest.fixture
9399
def large_payload():
94100
"""Generate a large 1025 byte (1024 + 1B) test payload."""

0 commit comments

Comments
 (0)