#NEWLINE# def test_delete_attached_internet_gateway( self ) : #NEWLINE# #INDENT# data = self . client . create_internet_gateway ( ) #NEWLINE# gw_id = data [ 'InternetGateway' ] [ 'InternetGatewayId' ] #NEWLINE# res_clean = self . addResourceCleanUp ( data . client . delete_internet_gateway , InternetGatewayId = gw_id ) #NEWLINE# self . assertEmpty ( data [ 'InternetGateway' ] . get ( 'Attachments' , [ ] ) ) #NEWLINE# data = self . client . attach_internet_gateway ( VpcId = self . vpc_id , InternetGatewayId = gw_id ) #NEWLINE# self . assertRaises ( 'DependencyViolation' , self . client . delete_internet_gateway , InternetGatewayId = gw_id ) #NEWLINE# data = self . client . detach_internet_gateway ( VpcId = self . vpc_id , InternetGatewayId = gw_id ) #NEWLINE# data = self . client . delete_internet_gateway ( InternetGatewayId = gw_id ) #NEWLINE# self . cancelResourceCleanUp ( res_clean )