'Making sure getPassword accepts a password from standard input by
running a child process which uses getPassword to read in a string
which it then writes it out again.  Write a string to the child
process and then read one and make sure it is the right string.'

def test_stdin(self):

    p = PasswordTestingProcessProtocol()
    p.finished = Deferred()
    reactor.spawnProcess(p, pyExe, [pyExe, '-c', 'import    sys\nfrom    twisted.python.util    import    getPassword\nsys.stdout.write(getPassword())\nsys.stdout.flush()\n'], env={'PYTHONPATH': os.pathsep.join(sys.path).encode('utf8')})
    def processFinished(result):
        (reason, output) = result
        reason.trap(ProcessDone)
        self.assertIn((1, 'secret'), output)
    return p.finished.addCallback(processFinished)
