forked from TrueCloudLab/s3-tests
Add a test that uses Key.set_contents_from_file, to trigger 100 Continue.
This commit is contained in:
parent
e8a5077913
commit
818523f48c
1 changed files with 13 additions and 0 deletions
13
test_s3.py
13
test_s3.py
|
@ -1,3 +1,4 @@
|
|||
from cStringIO import StringIO
|
||||
import ConfigParser
|
||||
import boto.exception
|
||||
import boto.s3.connection
|
||||
|
@ -253,6 +254,18 @@ def test_object_set_get_metadata():
|
|||
eq(got, 'mymeta')
|
||||
|
||||
|
||||
def test_object_write_file():
|
||||
# boto Key.set_contents_from_file / .send_file uses Expect:
|
||||
# 100-Continue, so this test exercises that (though a bit too
|
||||
# subtly)
|
||||
bucket = get_new_bucket()
|
||||
key = bucket.new_key('foo')
|
||||
data = StringIO('bar')
|
||||
key.set_contents_from_file(fp=data)
|
||||
got = key.get_contents_as_string()
|
||||
eq(got, 'bar')
|
||||
|
||||
|
||||
def check_bad_bucket_name(name):
|
||||
e = assert_raises(boto.exception.S3ResponseError, s3.main.create_bucket, name)
|
||||
eq(e.status, 400)
|
||||
|
|
Loading…
Add table
Reference in a new issue