@mock_ec2
def test_modify_attribute_blockDeviceMapping():
 conn = boto.ec2.connect_to_region(u'us-east-1')
 reservation = conn.run_instances(u'ami-1234abcd')
 instance = reservation.instances[0]
 with assert_raises(JSONResponseError) as ex:
  instance.modify_attribute(u'blockDeviceMapping', {u'/dev/sda1': True}, dry_run=True)
 ex.exception.reason.should.equal(u'DryRunOperation')
 ex.exception.status.should.equal(400)
 ex.exception.message.should.equal(u'An error occurred (DryRunOperation) when calling the ModifyInstanceAttribute operation: Request would have succeeded, but DryRun flag is set')
 instance.modify_attribute(u'blockDeviceMapping', {u'/dev/sda1': True})
 instance = ec2_backends[conn.region.name].get_instance(instance.id)
 instance.block_device_mapping.should.have.key(u'/dev/sda1')
 instance.block_device_mapping[u'/dev/sda1'].delete_on_termination.should.be(True)

@ mock_ec2 def test_modify_attribute_blockDeviceMapping ( ) : conn = boto . ec2 . connect_to_region ( u'us-east-1' ) reservation = conn . run_instances ( u'ami-1234abcd' ) instance = reservation . instances [ 0 ] with assert_raises ( JSONResponseError ) as ex : instance . modify_attribute ( u'blockDeviceMapping' , { u'/dev/sda1' : True } , dry_run = True ) ex . exception . reason . should . equal ( u'DryRunOperation' ) ex . exception . status . should . equal ( 400 ) ex . exception . message . should . equal ( u'An error occurred (DryRunOperation) when calling the ModifyInstanceAttribute operation: Request would have succeeded, but DryRun flag is set' ) instance . modify_attribute ( u'blockDeviceMapping' , { u'/dev/sda1' : True } ) instance = ec2_backends [ conn . region . name ] . get_instance ( instance . id ) instance . block_device_mapping . should . have . key ( u'/dev/sda1' ) instance . block_device_mapping [ u'/dev/sda1' ] . delete_on_termination . should . be ( True )
reproduces the missing feature explained at [0] .