'Verify that L{TopWindow.repaint} schedules an actual paint to occur
using the scheduling object passed to its initializer.'

def test_paintScheduling(self):

    paints = []
    scheduled = []
    root = TopWindow((lambda : paints.append(None)), scheduled.append)
    self.assertEqual(paints, [])
    self.assertEqual(scheduled, [])
    root.repaint()
    self.assertEqual(paints, [])
    self.assertEqual(len(scheduled), 1)
    root.repaint()
    self.assertEqual(paints, [])
    self.assertEqual(len(scheduled), 1)
    scheduled.pop()()
    self.assertEqual(len(paints), 1)
    self.assertEqual(scheduled, [])
    root.repaint()
    self.assertEqual(len(paints), 1)
    self.assertEqual(len(scheduled), 1)
