def test_addReader(self):
        reactor = self.buildReactor()

        class DataProtocol(Protocol):
            data = b""
            def dataReceived(self, data):
                self.data += data
                # It'd be better to stop reactor on connectionLost, but that
                # fails on FreeBSD, probably due to
                # http://bugs.python.org/issue9591:
                if self.data == b"hello!":
                    reactor.stop()

        path = self.mktemp()

        with open(path, "wb") as f:
            f.write(b"hello!")

        with open(path, "rb") as f:
            # Read bytes from a file, deliver them to a protocol instance:
            protocol = DataProtocol()
            StandardIO(protocol, stdin=f.fileno(),
                       stdout=self.extraFile.fileno(),
                       reactor=reactor)
            self.runReactor(reactor)

        self.assertEqual(protocol.data, b"hello!")
Sets the value for a given key in a plist.
dataset/ETHPy150Open twisted/twisted/twisted/internet/test/test_stdio.py/StdioFilesTests.test_addReader--crossover with--dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/gmacpyutil.py/SetPlistKey