Allow writing empty body to s3 key if content-length is zero. Better fix for #6.
This commit is contained in:
parent
756955b61e
commit
e64c73efed
2 changed files with 25 additions and 13 deletions
|
|
@ -62,6 +62,20 @@ def test_empty_key():
|
|||
bucket.get_key("the-key").get_contents_as_string().should.equal('')
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_empty_key_set_on_existing_key():
|
||||
conn = boto.connect_s3('the_key', 'the_secret')
|
||||
bucket = conn.create_bucket("foobar")
|
||||
key = Key(bucket)
|
||||
key.key = "the-key"
|
||||
key.set_contents_from_string("foobar")
|
||||
|
||||
bucket.get_key("the-key").get_contents_as_string().should.equal('foobar')
|
||||
|
||||
key.set_contents_from_string("")
|
||||
bucket.get_key("the-key").get_contents_as_string().should.equal('')
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_copy_key():
|
||||
conn = boto.connect_s3('the_key', 'the_secret')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue