#NEWLINE# @ mock_cloudformation ( ) #NEWLINE# @ mock_ec2 ( ) #NEWLINE# @ mock_route53 ( ) #NEWLINE# def test_route53_ec2_instance_with_public_ip( ) : #NEWLINE# #INDENT# route53_conn = boto . connect_route53 ( ) #NEWLINE# ec2_conn = boto . ec2 . connect_to_region ( 'us-west-1' ) #NEWLINE# template_json = json . dumps ( route53_ec2_instance_with_public_ip . template ) #NEWLINE# conn = boto . cloudformation . connect_to_region ( 'us-west-1' ) #NEWLINE# conn . create_stack ( 'test_stack' , template_body = template_json ) #NEWLINE# instance_id = ec2_conn . get_all_reservations ( ) [ 0 ] . instances [ 0 ] . id #NEWLINE# zones = route53_conn . get_all_hosted_zones ( ) [ 'ListHostedZonesResponse' ] [ 'HostedZones' ] #NEWLINE# list ( zones ) . should . have . length_of ( 1 ) #NEWLINE# zone_id = zones [ 0 ] [ 'Id' ] #NEWLINE# rrsets = route53_conn . get_all_rrsets ( zone_id ) #NEWLINE# rrsets . should . have . length_of ( 1 ) #NEWLINE# record_set1 = rrsets [ 0 ] #NEWLINE# record_set1 . name . should . equal ( '{0}.us-west-1.my_zone.' . format ( zones ) ) #NEWLINE# record_set1 . identifier . should . equal ( None ) #NEWLINE# record_set1 . type . should . equal ( 'A' ) #NEWLINE# record_set1 . ttl . should . equal ( '900' ) #NEWLINE# record_set1 . weight . should . equal ( None ) #NEWLINE# record_set1 . resource_records [ 0 ] . should . equal ( '10.0.0.25' )