Skip to content

Commit 49b2f70

Browse files
committed
tests: Adjust the SFTP tests to new chunk size
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 265cae1 commit 49b2f70

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/unit/sftp_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import pytest
1010

11+
from pylibsshext.sftp import SFTP_MAX_CHUNK
12+
1113

1214
@pytest.fixture
1315
def sftp_session(ssh_client_session):
@@ -21,16 +23,17 @@ def sftp_session(ssh_client_session):
2123

2224

2325
@pytest.fixture(
24-
params=(32, 1024 + 1),
26+
params=(32, SFTP_MAX_CHUNK + 1),
2527
ids=('small-payload', 'large-payload'),
2628
)
2729
def transmit_payload(request: pytest.FixtureRequest) -> bytes:
2830
"""Generate binary test payloads of assorted sizes.
2931
3032
The choice 32 is arbitrary small value.
3133
32-
The choice 1024 + 1 is meant to be 1B larger than the chunk size used in
33-
:file:`sftp.pyx` to make sure we excercise at least two rounds of reading/writing.
34+
The choice SFTP_MAX_CHUNK + 1 (32kB + 1B) is meant to be 1B larger than the chunk
35+
size used in :file:`sftp.pyx` to make sure we excercise at least two rounds of
36+
reading/writing.
3437
"""
3538
payload_len = request.param
3639
random_bytes = [ord(random.choice(string.printable)) for _ in range(payload_len)]

0 commit comments

Comments
 (0)