Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import s3fs
import json
import pytest
import requests

from moto.moto_server.threaded_moto_server import ThreadedMotoServer

Expand All @@ -15,6 +16,18 @@
secure_bucket_name = "test-secure"


def s3_url_exists(url: str) -> bool:
try:
response = requests.get(
url,
timeout=10, # seconds
)
except requests.exceptions.RequestException:
return False
else:
return response.status_code == 200


def get_boto3_client():
from botocore.session import Session

Expand Down
7 changes: 7 additions & 0 deletions tests/test_buffer_issue.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os

import pyfive
import pytest
import s3fs

from conftest import s3_url_exists


def _load_nc_file(ncvar):
"""
Expand All @@ -26,6 +29,10 @@ def _load_nc_file(ncvar):
return ds


JASMIN_ONLINE = s3_url_exists("https://uor-aces-o.s3-ext.jc.rl.ac.uk/esmvaltool-zarr")


@pytest.mark.skipif(not JASMIN_ONLINE, reason="CEDA S3 object store offline.")
def test_buffer_issue():
"""
Test the case when the attribute contains no data.
Expand Down
Loading