Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion python/kvikio/tests/test_http_io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
# SPDX-License-Identifier: Apache-2.0


Expand Down Expand Up @@ -174,6 +174,19 @@ def test_no_range_support(http_server, tmpdir, xp):
f.read(b, size=10, file_offset=10)


@pytest.mark.parametrize("http_server", [{"range_support": False}], indirect=True)
@pytest.mark.parametrize("file_offset", [0, 100])
def test_zero_size_read_returns_without_range_request(http_server, tmpdir, file_offset):
a = np.arange(100, dtype="uint8")
a.tofile(tmpdir / "a")
b = np.full(10, 42, dtype="uint8")

with kvikio.RemoteFile.open_http(f"{http_server}/a") as f:
assert f.read(b, size=0, file_offset=file_offset) == 0

np.testing.assert_array_equal(b, np.full_like(b, 42))


def test_retry_http_503_ok(tmpdir, xp):
a = xp.arange(100, dtype="uint8")
a.tofile(tmpdir / "a")
Expand Down