    def test_double_buffer(self):
        """
        Check _DoubleBuffer works.
        """
        buffer = _DoubleBuffer(20, 10)

        # Check clear works
        self.assertEqual(buffer._double_buffer[0][0], (' ', 7, 0, 0, 1))
        self.assertEqual(buffer._double_buffer[19][9], (' ', 7, 0, 0, 1))
        buffer.clear(1, 0, 2)
        self.assertEqual(buffer._double_buffer[0][0], (' ', 1, 0, 2, 1))
        self.assertEqual(buffer._double_buffer[19][9], (' ', 1, 0, 2, 1))

        # Check clear clips as needed.
        buffer.clear(3, 1, 4, x=1, y=1, w=100, h=100)
        self.assertEqual(buffer._double_buffer[0][0], (' ', 1, 0, 2, 1))
        self.assertEqual(buffer._double_buffer[19][9], (' ', 3, 1, 4, 1))
Check _DoubleBuffer works.
tests/test_screen.py