@mock_ec2
def test_tag_spot_instance_request():
 conn = boto.connect_ec2()
 request = conn.request_spot_instances(price=0.5, image_id=u'ami-abcd1234')
 request[0].add_tag(u'tag1', u'value1')
 request[0].add_tag(u'tag2', u'value2')
 requests = conn.get_all_spot_instance_requests()
 requests.should.have.length_of(1)
 request = requests[0]
 tag_dict = dict(request.tags)
 tag_dict.should.equal({u'tag1': u'value1', u'tag2': u'value2'})

@ mock_ec2 def test_tag_spot_instance_request ( ) : conn = boto . connect_ec2 ( ) request = conn . request_spot_instances ( price = 0.5 , image_id = u'ami-abcd1234' ) request [ 0 ] . add_tag ( u'tag1' , u'value1' ) request [ 0 ] . add_tag ( u'tag2' , u'value2' ) requests = conn . get_all_spot_instance_requests ( ) requests . should . have . length_of ( 1 ) request = requests [ 0 ] tag_dict = dict ( request . tags ) tag_dict . should . equal ( { u'tag1' : u'value1' , u'tag2' : u'value2' } )
test that moto correctly tags a spot instance request .