Cleanup S3 model methods to better deal with missing buckets.
This commit is contained in:
parent
be25a2ba99
commit
5e35348c0d
4 changed files with 104 additions and 76 deletions
|
|
@ -149,6 +149,16 @@ def test_list_multiparts():
|
|||
uploads.should.be.empty
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_key_save_to_missing_bucket():
|
||||
conn = boto.connect_s3('the_key', 'the_secret')
|
||||
bucket = conn.get_bucket('mybucket', validate=False)
|
||||
|
||||
key = Key(bucket)
|
||||
key.key = "the-key"
|
||||
key.set_contents_from_string.when.called_with("foobar").should.throw(S3ResponseError)
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_missing_key():
|
||||
conn = boto.connect_s3('the_key', 'the_secret')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue