File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import pytest
10
10
11
+ from pylibsshext .sftp import SFTP_MAX_CHUNK
12
+
11
13
12
14
@pytest .fixture
13
15
def sftp_session (ssh_client_session ):
@@ -21,16 +23,17 @@ def sftp_session(ssh_client_session):
21
23
22
24
23
25
@pytest .fixture (
24
- params = (32 , 1024 + 1 ),
26
+ params = (32 , SFTP_MAX_CHUNK + 1 ),
25
27
ids = ('small-payload' , 'large-payload' ),
26
28
)
27
29
def transmit_payload (request : pytest .FixtureRequest ) -> bytes :
28
30
"""Generate binary test payloads of assorted sizes.
29
31
30
32
The choice 32 is arbitrary small value.
31
33
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.
34
37
"""
35
38
payload_len = request .param
36
39
random_bytes = [ord (random .choice (string .printable )) for _ in range (payload_len )]
You can’t perform that action at this time.
0 commit comments