//  [python]
def test_check_internal_data_three_channels(self):
        width = self._PLOT_WIDTH
        plotter = self.make_a_Plotter("lines", "scroll")
        (tg, plot) = (Mock(), numpy.zeros((width, self._PLOT_HEIGHT), numpy.uint8))
        plotter.display_on(tg_and_plot=(tg, plot))
        test_triplesource1 = self.make_a_PlotSource(channels=3)

        self.ready_plot_source(plotter, test_triplesource1)

        unique1, _ = numpy.unique(plot, return_counts=True)
        self.assertTrue(numpy.all(unique1 == [0]),
                        "Checking all pixels start as 0")

        # Three data samples
        all_data = []
        for d_idx in range(3):
            all_data.append(test_triplesource1.data())
            plotter.data_add(all_data[-1])

        # all_data is now [(10, 15, 40), (11, 16, 41), (12, 17, 42)]
        self.assertEqual(plotter._data_y_pos[0][0:3],
                         array.array('i', [90, 89, 88]),
                         "channel 0 plotted y positions")
        self.assertEqual(plotter._data_y_pos[1][0:3],
                         array.array('i', [85, 84, 83]),
                         "channel 1 plotted y positions")
        self.assertEqual(plotter._data_y_pos[2][0:3],
                         array.array('i', [60, 59, 58]),
                         "channel 2 plotted y positions")

        # Fill rest of screen
        for d_idx in range(197):
            all_data.append(test_triplesource1.data())
            plotter.data_add(all_data[-1])

        # Three values more values to force a scroll
        for d_idx in range(3):
            all_data.append(test_triplesource1.data())
            plotter.data_add(all_data[-1])

        # all_data[-4] is (49, 54, 59)
        # all_data[-3:0] is [(50, 55, 40) (51, 56, 41) (52, 57, 42)]
        expected_data_size = width - self._SCROLL_PX + 3
        st_x_pos = width - self._SCROLL_PX
        d_idx = plotter._data_idx - 3

        self.assertTrue(self._SCROLL_PX > 3,
                        "Ensure no scrolling occurred from recent 3 values")
        # the data_idx here is 2 because the size is now plot_width + 1
        self.assertEqual(plotter._data_idx, 2)
        self.assertEqual(plotter._x_pos, st_x_pos + 3)
        self.assertEqual(plotter._data_values, expected_data_size)
        self.assertEqual(plotter._values, len(all_data))

        if verbose >= 4:
            print("YP",d_idx, plotter._data_y_pos[0][d_idx:d_idx+3])
            print("Y POS", [str(plotter._data_y_pos[ch_idx][d_idx:d_idx+3])
                            for ch_idx in [0, 1, 2]])
        ch0_ypos = [50, 49, 48]
        self.assertEqual([plotter._data_y_pos[0][idx] for idx in range(d_idx, d_idx + 3)],
                         ch0_ypos,
                         "channel 0 plotted y positions")
        ch1_ypos = [45, 44, 43]
        self.assertEqual([plotter._data_y_pos[1][idx] for idx in range(d_idx, d_idx + 3)],
                         ch1_ypos,
                         "channel 1 plotted y positions")
        ch2_ypos = [60, 59, 58]
        self.assertEqual([plotter._data_y_pos[2][idx] for idx in range(d_idx, d_idx + 3)],
                         ch2_ypos,
                         "channel 2 plotted y positions")

        # Check for plot points - fortunately none overlap
        total_pixel_matches = 0
        for ch_idx, ch_ypos in enumerate((ch0_ypos, ch1_ypos, ch2_ypos)):
            expected = plotter.channel_colidx[ch_idx]
            for idx, y_pos in enumerate(ch_ypos):
                actual = plot[st_x_pos+idx, y_pos]
                if actual == expected:
                    total_pixel_matches += 1
                else:
                    if verbose >= 4:
                        print("Pixel value for channel",
                              "{:d}, naive expectation {:d},".format(ch_idx,
                                                                     expected),
                              "actual {:d} at {:d}, {:d}, {:d}".format(idx,
                                                                       actual,
                                                                       st_x_pos + idx,
                                                                       y_pos))
        # Only 7 out of 9 will match because channel 2 put a vertical
        # line at x position 175 over-writing ch0 and ch1
        self.assertEqual(total_pixel_matches, 7, "plotted pixels check")
        # Check for that line from pixel positions 42 to 60
        for y_pos in range(42, 60 + 1):
            self.assertEqual(plot[st_x_pos, y_pos],
                             plotter.channel_colidx[2],
                             "channel 2 (over-writing) vertical line")

        plotter.display_off()