'Are we writing the correct bits into the image?
Using private interfaces, forcing a capi access and
a pyaccess for the same image'

def _test_set_access(self, im, color):

    caccess = im.im.pixel_access(False)
    access = PyAccess.new(im, False)
    (w, h) = im.size
    for x in range(0, w, 10):
        for y in range(0, h, 10):
            access[(x, y)] = color
            self.assertEqual(color, caccess[(x, y)])
    access = PyAccess.new(im, True)
    with self.assertRaises(ValueError):
        access[(0, 0)] = color
