Skip to content

Commit c401f2e

Browse files
committed
Update tests
1 parent bec3e53 commit c401f2e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/apify_client/_http_clients/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(
145145
def _parse_params(params: dict[str, Any] | None) -> dict[str, Any] | None:
146146
"""Convert request parameters to Apify API-compatible formats.
147147
148-
Converts booleans to 0/1, lists to comma-separated strings, datetimes to ISO 8601 Zulu format.
148+
Converts booleans to 'false'/'true', lists to comma-separated strings, datetimes to ISO 8601 Zulu format.
149149
"""
150150
if params is None:
151151
return None

tests/unit/test_http_clients.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ def test_parse_params_none() -> None:
183183

184184

185185
def test_parse_params_boolean() -> None:
186-
"""Test _parse_params converts booleans to integers."""
186+
"""Test _parse_params converts booleans to `false` or `true`."""
187187
result = HttpClient._parse_params({'flag': True, 'disabled': False})
188-
assert result == {'flag': 1, 'disabled': 0}
188+
assert result == {'flag': 'true', 'disabled': 'false'}
189189

190190

191191
def test_parse_params_list() -> None:
@@ -224,7 +224,7 @@ def test_parse_params_mixed() -> None:
224224
assert result == {
225225
'limit': 10,
226226
'offset': 0,
227-
'flag': 1,
227+
'flag': 'true',
228228
'tags': 'tag1,tag2',
229229
'created_at': '2024-01-15T10:30:45.123Z',
230230
'name': 'test',
@@ -377,7 +377,7 @@ def test_prepare_request_call_with_params() -> None:
377377

378378
_headers, params, _data = client._prepare_request_call(params={'limit': 10, 'flag': True})
379379

380-
assert params == {'limit': 10, 'flag': 1}
380+
assert params == {'limit': 10, 'flag': 'true'}
381381

382382

383383
def test_build_url_with_params_none() -> None:

tests/unit/test_logging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def mock_api(httpserver: HTTPServer) -> None:
206206
)
207207

208208
httpserver.expect_request(
209-
f'/v2/actor-runs/{_MOCKED_RUN_ID}/log', method='GET', query_string='stream=1&raw=1'
209+
f'/v2/actor-runs/{_MOCKED_RUN_ID}/log', method='GET', query_string='stream=true&raw=true'
210210
).respond_with_handler(_streaming_log_handler)
211211

212212

@@ -486,7 +486,7 @@ async def test_streamed_log_async_restart_after_normal_completion(httpserver: HT
486486
"""Test that StreamedLogAsync cannot be restarted after task completes normally."""
487487
# Set up a quick-completing stream endpoint
488488
httpserver.expect_request(
489-
f'/v2/actor-runs/{_MOCKED_RUN_ID}/log', method='GET', query_string='stream=1&raw=1'
489+
f'/v2/actor-runs/{_MOCKED_RUN_ID}/log', method='GET', query_string='stream=true&raw=true'
490490
).respond_with_data(b'Quick log\n', content_type='application/octet-stream')
491491

492492
# Set up actor info endpoint (needed for get_streamed_log)

0 commit comments

Comments
 (0)