From 9e344cf82e33b25a203792fda57ecc6e4f69e53b Mon Sep 17 00:00:00 2001 From: malmans2 Date: Tue, 5 Nov 2024 19:31:34 +0100 Subject: [PATCH 1/2] test big file --- tests/integration_test_90_features.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration_test_90_features.py b/tests/integration_test_90_features.py index 32ab4e7..6894dfe 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,15 @@ 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: + 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 From add7415a9e80965371ddc87b0bfca23d0ed7065e Mon Sep 17 00:00:00 2001 From: malmans2 Date: Tue, 5 Nov 2024 19:39:14 +0100 Subject: [PATCH 2/2] qa --- tests/integration_test_90_features.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_test_90_features.py b/tests/integration_test_90_features.py index 6894dfe..dbf08d0 100644 --- a/tests/integration_test_90_features.py +++ b/tests/integration_test_90_features.py @@ -72,7 +72,10 @@ def test_features_mars_cds_adaptor_format( assert os.path.getsize(result) -def test_features_upload_big_file(api_anon_client: ApiClient, tmp_path: pathlib.Path) -> None: +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(