allow running mock_s3 and mock_s3bucket_path one after the other
This commit is contained in:
parent
86cba4e82c
commit
f46c2508c0
@ -61,6 +61,7 @@ class MockAWS(object):
|
|||||||
|
|
||||||
if self.__class__.nested_count == 0:
|
if self.__class__.nested_count == 0:
|
||||||
HTTPretty.disable()
|
HTTPretty.disable()
|
||||||
|
HTTPretty.reset()
|
||||||
|
|
||||||
def decorate_callable(self, func):
|
def decorate_callable(self, func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
25
tests/test_s3bucket_path/test_s3bucket_path_combo.py
Normal file
25
tests/test_s3bucket_path/test_s3bucket_path_combo.py
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user