#NEWLINE# @ mock . patch . object ( client . Client , 'update_port' ) #NEWLINE# @ mock . patch . object ( client . Client , '__init__' ) #NEWLINE# def test_update_port_address_with_exception( self , mock_client_init , mock_update_port ) : #NEWLINE# #INDENT# address = 'fe:54:00:77:07:d9' #NEWLINE# port_id = 'fake-port-id' #NEWLINE# mock_client_init . return_value = None #NEWLINE# api = dhcp_factory . DHCPFactory ( ) #NEWLINE# mock_update_port . side_effect = neutron_client_exc . NeutronClientException ( ) #NEWLINE# self . assertRaises ( exception . FailedToUpdateMacOnPort , api . provider . update_port_address , port_id , address )