forked from getmoto/moto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request getmoto#310 from kouk/bucket_path_combo
allow running mock_s3 and mock_s3bucket_path one after the other
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from __future__ import unicode_literals | ||
|
||
import boto | ||
from boto.s3.connection import OrdinaryCallingFormat | ||
|
||
from moto import mock_s3bucket_path, mock_s3 | ||
|
||
|
||
def create_connection(key=None, secret=None): | ||
return boto.connect_s3(key, secret, calling_format=OrdinaryCallingFormat()) | ||
|
||
|
||
def test_bucketpath_combo_serial(): | ||
@mock_s3bucket_path | ||
def make_bucket_path(): | ||
conn = create_connection() | ||
conn.create_bucket('mybucketpath') | ||
|
||
@mock_s3 | ||
def make_bucket(): | ||
conn = boto.connect_s3('the_key', 'the_secret') | ||
conn.create_bucket('mybucket') | ||
|
||
make_bucket() | ||
make_bucket_path() |