#NEWLINE# def _update_port_with_address( self , address , mac_address = None , **kwargs ) : #NEWLINE# #INDENT# body = self . client . create_port ( network_id = self . network [ 'id' ] ) #NEWLINE# port_id = body [ 'port' ] [ 'id' ] #NEWLINE# self . addCleanup ( self . client . delete_port , port_id ) #NEWLINE# if ( mac_address is None ) : #NEWLINE# #INDENT# mac_address = body . mac_address #NEWLINE# #UNINDENT# allowed_address_pairs = [ { #NEWLINE# #INDENT# 'ip_address' : address , #NEWLINE# 'mac_address' : mac_address , #NEWLINE# #UNINDENT# } ] #NEWLINE# if kwargs : #NEWLINE# #INDENT# allowed_address_pairs . append ( kwargs [ 'allowed_address_pairs' ] ) #NEWLINE# #UNINDENT# body = self . client . update_port ( port_id , allowed_address_pairs = allowed_address_pairs ) #NEWLINE# allowed_address_pair = body [ 'port' ] [ 'allowed_address_pairs' ] #NEWLINE# self . assertEqual ( allowed_address_pair , allowed_address_pairs )