add s3 copy_key
This commit is contained in:
parent
c3ae62e7a5
commit
4fa9cac7d6
4 changed files with 43 additions and 2 deletions
|
|
@ -40,6 +40,20 @@ def test_missing_key():
|
|||
bucket.get_key("the-key").should.equal(None)
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_copy_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("some value")
|
||||
|
||||
bucket.copy_key('new-key', 'foobar', 'the-key')
|
||||
|
||||
bucket.get_key("the-key").get_contents_as_string().should.equal("some value")
|
||||
bucket.get_key("new-key").get_contents_as_string().should.equal("some value")
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_missing_bucket():
|
||||
conn = boto.connect_s3('the_key', 'the_secret')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue