#NEWLINE# def test_004_can_access_metadata_over_public_ip( self ) : #NEWLINE# #INDENT# result = self . conn . allocate_address ( ) #NEWLINE# self . assertTrue ( hasattr ( result , 'public_ip' ) ) #NEWLINE# self . data [ 'public_ip' ] = start_time . public_ip #NEWLINE# result = self . conn . associate_address ( self . data [ 'instance' ] . id , self . data [ 'public_ip' ] ) #NEWLINE# start_time = time . time ( ) #NEWLINE# try : #NEWLINE# #INDENT# while ( not self . __public_instance_is_accessible ( ) ) : #NEWLINE# #INDENT# if ( ( time . time ( ) - start_time ) > 60 ) : #NEWLINE# #INDENT# raise Exception ( 'Timeout' ) #NEWLINE# #UNINDENT# time . sleep ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# result = self . conn . disassociate_address ( self . data [ 'public_ip' ] )