add s3 copy_key

This commit is contained in:
Steve Pulec 2013-02-19 23:29:46 -05:00
commit 4fa9cac7d6
4 changed files with 43 additions and 2 deletions

View file

@ -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')