Skip to content

Commit

Permalink
Update tests for moto 2
Browse files Browse the repository at this point in the history
Need to change our test fixtures to match up with the changes since 1.3.6.
  • Loading branch information
bjgill committed May 12, 2021
1 parent c33d09e commit 1777753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": null,
"lines": null
},
"generated_at": "2021-02-10T17:15:51Z",
"generated_at": "2021-05-11T16:38:44Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -234,14 +234,14 @@
"hashed_secret": "a74dcad10ebcdbad1049f116bc34fe5bf5f91ed8",
"is_secret": false,
"is_verified": false,
"line_number": 21,
"line_number": 24,
"type": "Secret Keyword"
},
{
"hashed_secret": "8fd17a4f88a78455ef94e43c20e2a78826ce8138",
"is_secret": false,
"is_verified": false,
"line_number": 113,
"line_number": 165,
"type": "AWS Access Key"
}
]
Expand Down
8 changes: 3 additions & 5 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@

@pytest.yield_fixture
def s3_mock(request, os_environ):
m = mock_s3()
# we don't want any real aws credentials this environment might have used in the tests
os_environ.update({
m.FAKE_KEYS.update({
"AWS_ACCESS_KEY_ID": "AKIAIABCDABCDABCDABC",
"AWS_SECRET_ACCESS_KEY": "foobarfoobarfoobarfoobarfoobarfoobarfoob",
})

m = mock_s3()
m.start()
yield m
m.stop()
Expand All @@ -32,8 +31,7 @@ def s3_mock(request, os_environ):
@pytest.yield_fixture
def empty_bucket(request, s3_mock):
s3_res = boto3.resource("s3", region_name=default_region)
bucket = s3_res.Bucket("dear-liza")
bucket.create()
bucket = s3_res.create_bucket(Bucket="dear-liza", CreateBucketConfiguration={'LocationConstraint': default_region})
yield bucket


Expand Down

0 comments on commit 1777753

Please sign in to comment.