#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_nack_on_invalid_msg( self ) : #NEWLINE# #INDENT# client = SMPPClientTransceiver ( self . config , ( lambda smpp , pdu : None ) ) #NEWLINE# smpp = ( yield client . connectAndBind ( ) ) #NEWLINE# msgSentDeferred = defer . Deferred ( ) #NEWLINE# smpp . sendPDU = mock . Mock ( ) #NEWLINE# smpp . sendPDU . side_effect = functools . partial ( self . mock_side_effect , msgSentDeferred ) #NEWLINE# ( yield msgSentDeferred ) #NEWLINE# ( yield smpp . disconnect ( ) ) #NEWLINE# self . assertEquals ( 1 , smpp . sendPDU . call_count ) #NEWLINE# smpp . sendPDU . assert_called_with ( QuerySMResp ( seqNum = self . protocol . seqNum , status = CommandStatus . ESME_RINVSRCTON ) )