def test_processEndedWithExitCode(self):
        """
        When processEnded is called, if there is an exit code in the reason
        it should be sent in an exit-status method.  The connection should be
        closed.
        """
        self.pp.processEnded(Failure(ProcessDone(None)))
        self.assertRequestsEqual(
            [(b'exit-status', struct.pack('>I', 0) , False)])
        self.assertSessionClosed()

        When processEnded is called, if there is an exit code in the reason
        it should be sent in an exit-status method.  The connection should be
        closed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_session.py