Skip to content

Commit 30494a2

Browse files
committed
adding missing file
1 parent 56468c8 commit 30494a2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

aws_test.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
from pathlib import Path
3+
4+
import boto3
5+
from botocore.exceptions import NoCredentialsError, ClientError
6+
7+
TEST_DATA_PATH = Path(__file__).parent / "data"
8+
TEST_S3_BUCKET = os.environ.get("CDXT_TEST_S3_BUCKET", "commoncrawl-ci-temp")
9+
10+
11+
def check_aws_s3_access():
12+
"""Check if AWS S3 access is available."""
13+
try:
14+
s3_client = boto3.client('s3')
15+
# Try to list buckets as a simple check
16+
s3_client.list_buckets()
17+
18+
s3_client.list_objects_v2(Bucket=TEST_S3_BUCKET, MaxKeys=1)
19+
20+
return True
21+
except (NoCredentialsError, ClientError):
22+
return False
23+
24+
25+
assert check_aws_s3_access()

0 commit comments

Comments
 (0)