#NEWLINE# @ mock . patch . object ( cmdgen , 'UdpTransportTarget' , autospec = True ) #NEWLINE# def test__get_transport_err( self , mock_transport , mock_cmdgen ) : #NEWLINE# #INDENT# mock_transport . side_effect = snmp_error . PySnmpError #NEWLINE# client = snmp . SNMPClient ( self . address , self . port , snmp . SNMP_V3 ) #NEWLINE# self . assertRaises ( snmp_error . PySnmpError , client . _get_transport ) #NEWLINE# mock_cmdgen . assert_called_once_with ( ) #NEWLINE# mock_transport . assert_called_once_with ( ( client . address , client . port ) )