

def test_callProcessExited(self):
    '\n        L{BaseProcess._callProcessExited} calls the C{processExited} method of\n        its C{proto} attribute and passes it a L{Failure} wrapping the given\n        exception.\n        '

    class FakeProto():
        reason = None

        def processExited(self, reason):
            self.reason = reason
    reason = RuntimeError('fake reason')
    process = BaseProcess(FakeProto())
    process._callProcessExited(reason)
    process.proto.reason.trap(RuntimeError)
    self.assertIdentical(reason, process.proto.reason.value)

dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/test/test_baseprocess.py BaseProcessTests.test_callProcessExited/original