Skip to content

Commit c3f052b

Browse files
committed
tests: Reproducer for #341
Signed-off-by: Jakub Jelen <[email protected]>
1 parent 6259650 commit c3f052b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/unit/sftp_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def sftp_session(ssh_client_session):
2323

2424

2525
@pytest.fixture(
26-
params=(32, SFTP_MAX_CHUNK + 1),
27-
ids=('small-payload', 'large-payload'),
26+
params=(32, SFTP_MAX_CHUNK + 1, 255 * 1024 + 1),
27+
ids=('small-payload', 'large-payload', 'huge-payload'),
2828
)
2929
def transmit_payload(request: pytest.FixtureRequest) -> bytes:
3030
"""Generate binary test payloads of assorted sizes.
@@ -34,6 +34,9 @@ def transmit_payload(request: pytest.FixtureRequest) -> bytes:
3434
The choice SFTP_MAX_CHUNK + 1 (32kB + 1B) is meant to be 1B larger than the chunk
3535
size used in :file:`sftp.pyx` to make sure we excercise at least two rounds of
3636
reading/writing.
37+
38+
The Choice T 255kB + 1B is meant to be 1B larger than OpenSSH SFTP server supported
39+
maximum reads and writes of 256 * 1024 - 1024 B per request.
3740
"""
3841
payload_len = request.param
3942
random_bytes = [ord(random.choice(string.printable)) for _ in range(payload_len)]

0 commit comments

Comments
 (0)