'Test the normal data case on both master_fd and stdin.'

def test__copy_to_each(self):

    (read_from_stdout_fd, mock_stdout_fd) = self._pipe()
    pty.STDOUT_FILENO = mock_stdout_fd
    (mock_stdin_fd, write_to_stdin_fd) = self._pipe()
    pty.STDIN_FILENO = mock_stdin_fd
    socketpair = socket.socketpair()
    masters = [s.fileno() for s in socketpair]
    self.fds.extend(masters)
    os.write(masters[1], 'from    master')
    os.write(write_to_stdin_fd, 'from    stdin')
    pty.select = self._mock_select
    self.select_rfds_lengths.append(2)
    self.select_rfds_results.append([mock_stdin_fd, masters[0]])
    self.select_rfds_lengths.append(2)
    with self.assertRaises(IndexError):
        pty._copy(masters[0])
    rfds = select.select([read_from_stdout_fd, masters[1]], [], [], 0)[0]
    self.assertEqual([read_from_stdout_fd, masters[1]], rfds)
    self.assertEqual(os.read(read_from_stdout_fd, 20), 'from    master')
    self.assertEqual(os.read(masters[1], 20), 'from    stdin')
