'The L{Deferred} returned by L{getProcessOutputAndValue} fires with a
three-tuple, the elements of which give the data written to the child\'s
stdout, the data written to the child\'s stderr, and the exit status of
the child.'

def test_outputAndValue(self):

    scriptFile = self.makeSourceFile(['import    sys', "if    hasattr(sys.stdout,    'buffer'):", '                #    Python    3', "                sys.stdout.buffer.write(b'hello    world!\\n')", "                sys.stderr.buffer.write(b'goodbye    world!\\n')", 'else:', '                #    Python    2', "                sys.stdout.write(b'hello    world!\\n')", "                sys.stderr.write(b'goodbye    world!\\n')", 'sys.exit(1)'])
    def gotOutputAndValue(out_err_code):
        (out, err, code) = out_err_code
        self.assertEqual(out, 'hello    world!\n')
        if _PY3:
            self.assertEqual(err, 'goodbye    world!\n')
        else:
            self.assertEqual(err, ('goodbye    world!' + os.linesep))
        self.assertEqual(code, 1)
    d = utils.getProcessOutputAndValue(self.exe, ['-u', scriptFile])
    return d.addCallback(gotOutputAndValue)
