Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mocking aws service #34

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading