From 5d99da5b7520ca2c75b4ebf6ba1d8e3a9aab3fad Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Wed, 6 Nov 2024 09:13:00 +0100 Subject: [PATCH] test upload big file (#113) * test big file * qa --- tests/integration_test_90_features.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration_test_90_features.py b/tests/integration_test_90_features.py index 32ab4e7..dbf08d0 100644 --- a/tests/integration_test_90_features.py +++ b/tests/integration_test_90_features.py @@ -1,4 +1,6 @@ +import datetime import os +import pathlib from pathlib import Path from typing import Any @@ -68,3 +70,18 @@ def test_features_mars_cds_adaptor_format( _, actual_extension = os.path.splitext(result) assert actual_extension == expected_extension assert os.path.getsize(result) + + +def test_features_upload_big_file( + api_anon_client: ApiClient, tmp_path: pathlib.Path +) -> None: + # See: https://github.com/fsspec/s3fs/pull/910 + target = str(tmp_path / "test.grib") + size = 1_048_576_000 + 1 + api_anon_client.retrieve( + "test-adaptor-dummy", + size=size, + _timestamp=datetime.datetime.now().isoformat(), + target=target, + ) + assert os.path.getsize(target) == size