def test_success(self):
        """
        When double fork succeeded in C{daemonize}, the child process writes
        B{0} to the status pipe.
        """
        with AlternateReactor(FakeDaemonizingReactor()):
            self.runner.postApplication()
        self.assertEqual(
            self.mockos.actions,
            [('chdir', '.'), ('umask', 0o077), ('fork', True), 'setsid',
             ('fork', True), ('write', -2, b'0'), ('unlink', 'twistd.pid')])
        self.assertEqual(self.mockos.closed, [-3, -2])

        When double fork succeeded in C{daemonize}, the child process writes
        B{0} to the status pipe.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py