add most of the snapshot implementation
This commit is contained in:
parent
f92a3ec00f
commit
e261b82f29
4 changed files with 109 additions and 4 deletions
|
|
@ -48,3 +48,25 @@ def test_volume_attach_and_detach():
|
|||
volume.volume_state().should.equal('available')
|
||||
|
||||
conn.detach_volume.when.called_with(volume.id, instance.id, "/dev/sdh").should.throw(EC2ResponseError)
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_create_snapshot():
|
||||
conn = boto.connect_ec2('the_key', 'the_secret')
|
||||
volume = conn.create_volume(80, "us-east-1a")
|
||||
|
||||
volume.create_snapshot('a test snapshot')
|
||||
|
||||
snapshots = conn.get_all_snapshots()
|
||||
snapshots.should.have.length_of(1)
|
||||
snapshots[0].description.should.equal('a test snapshot')
|
||||
|
||||
# Create snapshot without description
|
||||
snapshot = volume.create_snapshot()
|
||||
conn.get_all_snapshots().should.have.length_of(2)
|
||||
|
||||
snapshot.delete()
|
||||
conn.get_all_snapshots().should.have.length_of(1)
|
||||
|
||||
# Deleting something that was already deleted should throw an error
|
||||
snapshot.delete.when.called_with().should.throw(EC2ResponseError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue