Skip to content

Commit 0c565c8

Browse files
Use random test data
1 parent c07a3fe commit 0c565c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_base_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import random
12
from http.server import BaseHTTPRequestHandler
23
from typing import Iterator, List
34
from unittest.mock import Mock
@@ -285,9 +286,10 @@ def inner(h: BaseHTTPRequestHandler):
285286
(200, 1, 100), # 100 / 200 bytes per chunk = 1 chunk
286287
])
287288
def test_streaming_response_chunk_size(chunk_size, expected_chunks, data_size):
288-
test_data = b"0" * data_size
289-
content_chunks = []
289+
rng = random.Random(42)
290+
test_data = bytes(rng.getrandbits(8) for _ in range(data_size))
290291

292+
content_chunks = []
291293
mock_response = Mock(spec=requests.Response)
292294

293295
def mock_iter_content(chunk_size):

0 commit comments

Comments
 (0)