Skip to content

Commit eb90d06

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/sftp_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ def test_get_existing(pre_existing_dst_path, src_path, sftp_session, transmit_pa
8888
assert pre_existing_dst_path.read_bytes() == transmit_payload
8989

9090

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

0 commit comments

Comments
 (0)