def test_write(self):
        """
        Verify that the C{write} method of the transport of a protocol
        connected to L{StandardIO} sends bytes to standard out.
        """
        p = StandardIOTestProcessProtocol()
        d = p.onCompletion

        self._spawnProcess(p, b'stdio_test_write')

        def processEnded(reason):
            self.assertEqual(p.data[1], b'ok!')
            reason.trap(error.ProcessDone)
        return self._requireFailure(d, processEnded)

        Verify that the C{write} method of the transport of a protocol
        connected to L{StandardIO} sends bytes to standard out.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_stdio.py