Skip to content

Commit

Permalink
Fix mocking aws service (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
applePrincess authored Aug 27, 2024
1 parent 6928fd4 commit 4572706
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import bucketstore
import os
import pytest
from moto import mock_s3
from moto import mock_aws
from typing import Generator


Expand All @@ -24,7 +24,7 @@ def login() -> Generator:
@pytest.fixture
def bucket() -> Generator:
"""fixture that provides a bucketstore bucket."""
with mock_s3():
with mock_aws():
yield bucketstore.get("bucketstore-playground", create=True)


Expand Down
6 changes: 3 additions & 3 deletions tests/test_bucketstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import sys
import tempfile
from moto import mock_s3
from moto import mock_aws


def dbg(text: str) -> None:
Expand All @@ -33,7 +33,7 @@ def test_login() -> None:
assert os.environ["AWS_DEFAULT_REGION"] == "us-east-1"


@mock_s3
@mock_aws
def test_buckets_can_be_created() -> None:
bucket = bucketstore.get("test-bucket", create=True)

Expand All @@ -43,7 +43,7 @@ def test_buckets_can_be_created() -> None:
assert "<S3Bucket" in repr(bucket)


@mock_s3
@mock_aws
def test_buckets_are_not_created_automatically() -> None:
with pytest.raises(ValueError):
bucketstore.get("non-existent-bucket")
Expand Down

0 comments on commit 4572706

Please sign in to comment.