def childConnectionLost(self, childFD):
        """
        Similarly to L{childDataReceived}, disable the automatic dispatch
        provided by the base implementation to verify that the transport is
        calling this method directly.
        """
        if childFD == 1:
            self.stages.append(2)
            if self.data != b"abcd":
                raise RuntimeError(
                    "Data was %r instead of 'abcd'" % (self.data,))
            self.transport.write(b"1234")
        elif childFD == 2:
            self.stages.append(3)
            if self.err != b"1234":
                raise RuntimeError(
                    "Err was %r instead of '1234'" % (self.err,))
            self.transport.write(b"abcd")
            self.stages.append(4)
        elif childFD == 0:
            self.stages.append(5)

        Similarly to L{childDataReceived}, disable the automatic dispatch
        provided by the base implementation to verify that the transport is
        calling this method directly.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py