@mock_ec2
def test_eip_associate_invalid_args():
 conn = boto.connect_ec2(u'the_key', u'the_secret')
 reservation = conn.run_instances(u'ami-1234abcd')
 instance = reservation.instances[0]
 eip = conn.allocate_address()
 with assert_raises(EC2ResponseError) as cm:
  conn.associate_address(instance_id=instance.id)
 cm.exception.code.should.equal(u'MissingParameter')
 cm.exception.status.should.equal(400)
 cm.exception.request_id.should_not.be.none
 instance.terminate()

@ mock_ec2 def test_eip_associate_invalid_args ( ) : conn = boto . connect_ec2 ( u'the_key' , u'the_secret' ) reservation = conn . run_instances ( u'ami-1234abcd' ) instance = reservation . instances [ 0 ] eip = conn . allocate_address ( ) with assert_raises ( EC2ResponseError ) as cm : conn . associate_address ( instance_id = instance . id ) cm . exception . code . should . equal ( u'MissingParameter' ) cm . exception . status . should . equal ( 400 ) cm . exception . request_id . should_not . be . none instance . terminate ( )
associate eip .