We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56468c8 commit 30494a2Copy full SHA for 30494a2
aws_test.py
@@ -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