Skip to content

Commit

Permalink
remove tests that expect error when bucket is not created
Browse files Browse the repository at this point in the history
  • Loading branch information
andeaseme committed Oct 24, 2023
1 parent d010dce commit 9d6c4cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
5 changes: 0 additions & 5 deletions s3dol/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def test_s3_dol_crud(aws_access_key_id, aws_secret_access_key, endpoint_url):
del s3_client[test_bucket_name]
assert test_bucket_name not in s3_client

with pytest.raises(KeyError):
s3_bucket = s3_client[test_bucket_name]
s3_client[test_bucket_name] = {}
s3_bucket = s3_client[test_bucket_name]
assert test_bucket_name in s3_client
Expand Down Expand Up @@ -134,9 +132,6 @@ def test_s3_client(
del s3_client[test_bucket_name]
assert test_bucket_name not in s3_client

with pytest.raises(KeyError):
s3_bucket = s3_client[test_bucket_name]

s3_client[test_bucket_name] = {}
s3_bucket = s3_client[test_bucket_name]
assert isinstance(s3_bucket, S3BucketDol)
Expand Down
13 changes: 1 addition & 12 deletions s3dol/tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from s3dol.store import S3Store
from s3dol.tests.test_base import assert_bucket_key_value
from s3dol.utility import S3DolException, S3KeyError
from s3dol.utility import S3DolException


def setup_test_bucket(aws_access_key_id, aws_secret_access_key, endpoint_url):
Expand All @@ -15,9 +15,6 @@ def setup_test_bucket(aws_access_key_id, aws_secret_access_key, endpoint_url):
if 'test-bucket' not in s3_client:
s3_client['test-bucket'] = {}

if 'not-a-bucket' in s3_client:
del s3_client['not-a-bucket']

if 'level1/level2/test-key' in s3_client['test-bucket']:
del s3_client['test-bucket']['level1/level2/test-key']

Expand All @@ -32,14 +29,6 @@ def test_s3_store_crud(aws_access_key_id, aws_secret_access_key, endpoint_url):
with pytest.raises(S3DolException):
s3_store = S3Store(bucket_name='test-bucket',)

with pytest.raises(S3KeyError):
s3_store = S3Store(
bucket_name='not-a-bucket',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
endpoint_url=endpoint_url,
)

s3_store = S3Store(
bucket_name='test-bucket',
aws_access_key_id=aws_access_key_id,
Expand Down

0 comments on commit 9d6c4cc

Please sign in to comment.