Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn committed Dec 19, 2023
1 parent 1b4618c commit 2842448
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/maggma/stores/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,8 @@ def _get_session(self):
def _get_endpoint_url(self):
if self.ssh_tunnel is None:
return self.endpoint_url
else:
host, port = self.ssh_tunnel.local_address
return f"http://{host}:{port}"
host, port = self.ssh_tunnel.local_address
return f"http://{host}:{port}"

Check warning on line 365 in src/maggma/stores/aws.py

View check run for this annotation

Codecov / codecov/patch

src/maggma/stores/aws.py#L364-L365

Added lines #L364 - L365 were not covered by tests

def _get_bucket(self):
"""If on the main thread return the bucket created above, else create a new
Expand All @@ -385,7 +384,7 @@ def _get_resource_and_bucket(self):
try:
resource.meta.client.head_bucket(Bucket=self.bucket)
except ClientError:
raise RuntimeError(f"Bucket not present on AWS")
raise RuntimeError("Bucket not present on AWS")
bucket = resource.Bucket(self.bucket)

return resource, bucket
Expand Down
5 changes: 3 additions & 2 deletions tests/stores/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import boto3
import pytest
from botocore.exceptions import ClientError
from maggma.stores import MemoryStore, MongoStore, S3Store
from maggma.stores.ssh_tunnel import SSHTunnel
from moto import mock_s3
from sshtunnel import BaseSSHTunnelForwarderError

from maggma.stores import MemoryStore, MongoStore, S3Store
from maggma.stores.ssh_tunnel import SSHTunnel


@pytest.fixture()
def mongostore():
Expand Down

0 comments on commit 2842448

Please sign in to comment.