Skip to content

Commit

Permalink
Add tests for combining config and kwargs (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Jan 30, 2025
1 parent 5082d96 commit 41d7511
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/store/test_s3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

import obstore as obs
from obstore.exceptions import ObstoreError
from obstore.store import S3Store


Expand All @@ -20,3 +21,15 @@ async def test_get_async(s3_store: S3Store):
def test_construct_store_boolean_config():
# Should allow boolean parameter
S3Store("bucket", skip_signature=True)


def test_error_overlapping_config_kwargs():
with pytest.raises(ObstoreError, match="Duplicate key"):
S3Store("bucket", config={"skip_signature": True}, skip_signature=True)

# Also raises for variations of the same parameter
with pytest.raises(ObstoreError, match="Duplicate key"):
S3Store("bucket", config={"aws_skip_signature": True}, skip_signature=True)

with pytest.raises(ObstoreError, match="Duplicate key"):
S3Store("bucket", config={"AWS_SKIP_SIGNATURE": True}, skip_signature=True)

0 comments on commit 41d7511

Please sign in to comment.