Skip to content

Commit

Permalink
update moto usage
Browse files Browse the repository at this point in the history
  • Loading branch information
c0state committed Sep 5, 2024
1 parent 1cf1c1a commit 6b3c040
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
try:
import boto3
import requests
from moto import mock_s3
from moto import mock_aws
except ImportError:
pytestmark = pytest.mark.skipif(True, reason="S3 support not installed")
raise

# -----------------------------------------------------------------------------


@pytest.fixture
def bucket_name():
with mock_s3():
with mock_aws():
bucket = boto3.resource("s3").Bucket("flask-annex")
bucket.create()

Expand Down Expand Up @@ -88,7 +89,7 @@ def test_get_upload_info(self, client):
assert upload_info["url"] == "https://flask-annex.s3.amazonaws.com/"
assert upload_info["post_data"][0] == ["Content-Type", "text/plain"]
assert upload_info["post_data"][1] == ["key", "foo/qux.txt"]
assert upload_info["post_data"][2] == ["AWSAccessKeyId", "foobar_key"]
assert upload_info["post_data"][2] == ["AWSAccessKeyId", "FOOBARKEY"]
assert upload_info["post_data"][3][0] == "policy"
assert upload_info["post_data"][4][0] == "signature"

Expand Down

0 comments on commit 6b3c040

Please sign in to comment.