Skip to content

Commit

Permalink
Fix build (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermef committed Jul 7, 2023
1 parent f47433d commit 6b90741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ async def upload():
session = get_session()
async with session.create_client(
"s3",
region_name="local",
region_name="us-east-1",
endpoint_url="https://localhost:4566",
) as client:

# Ensure Bucket is there
try:
location = {"LocationConstraint": "local"}
await client.create_bucket(
Bucket="fixtures",
CreateBucketConfiguration=location,
)
except client.exceptions.BucketAlreadyOwnedByYou:
pass
Expand Down
12 changes: 4 additions & 8 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ def get_config(self) -> Config:
)

# Storage Config
cfg.AWS_STORAGE_REGION_NAME = "local"
cfg.AWS_STORAGE_REGION_NAME = "us-east-1"
cfg.AWS_STORAGE_BUCKET_NAME = "test-bucket-st"
cfg.AWS_STORAGE_ROOT_PATH = "/test-st"
cfg.AWS_STORAGE_S3_ENDPOINT_URL = "https://localhost:4566"

# Result Storage Config
cfg.AWS_RESULT_STORAGE_REGION_NAME = "local"
cfg.AWS_RESULT_STORAGE_REGION_NAME = "us-east-1"
cfg.AWS_RESULT_STORAGE_BUCKET_NAME = "test-bucket-rs"
cfg.AWS_RESULT_STORAGE_S3_ENDPOINT_URL = "https://localhost:4566"
cfg.AWS_RESULT_STORAGE_ROOT_PATH = "/test-rs"
cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True

# Loader Config
cfg.AWS_LOADER_REGION_NAME = "local"
cfg.AWS_LOADER_REGION_NAME = "us-east-1"
cfg.AWS_LOADER_BUCKET_NAME = "test-bucket-st"
cfg.AWS_LOADER_ROOT_PATH = "/test-st"
cfg.AWS_LOADER_S3_ENDPOINT_URL = "https://localhost:4566"
Expand All @@ -83,7 +83,7 @@ def get_compatibility_config(self) -> Config:
)

cfg.THUMBOR_AWS_RUN_IN_COMPATIBILITY_MODE = True
cfg.TC_AWS_REGION = "local"
cfg.TC_AWS_REGION = "us-east-1"
cfg.TC_AWS_MAX_RETRY = 0
cfg.TC_AWS_ENDPOINT = "https://localhost:4566"

Expand Down Expand Up @@ -121,14 +121,10 @@ async def ensure_bucket(self):
"endpoint_url"
] = self.config.TC_AWS_ENDPOINT

location = {
"LocationConstraint": self.region_name,
}
async with s3client.get_client() as client:
try:
await client.create_bucket(
Bucket=self.bucket_name,
CreateBucketConfiguration=location,
)
except client.exceptions.BucketAlreadyOwnedByYou:
pass

0 comments on commit 6b90741

Please sign in to comment.