diff options
Diffstat (limited to 'lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/test/test_window.py')
-rwxr-xr-x | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/test/test_window.py | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/test/test_window.py b/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/test/test_window.py deleted file mode 100755 index 6d7d9d28..00000000 --- a/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/test/test_window.py +++ /dev/null @@ -1,67 +0,0 @@ - -""" -Tests for the insults windowing module, L{twisted.conch.insults.window}. -""" - -from twisted.trial.unittest import TestCase - -from twisted.conch.insults.window import TopWindow, ScrolledArea, TextOutput - - -class TopWindowTests(TestCase): - """ - Tests for L{TopWindow}, the root window container class. - """ - - def test_paintScheduling(self): - """ - Verify that L{TopWindow.repaint} schedules an actual paint to occur - using the scheduling object passed to its initializer. - """ - paints = [] - scheduled = [] - root = TopWindow(lambda: paints.append(None), scheduled.append) - - # Nothing should have happened yet. - self.assertEqual(paints, []) - self.assertEqual(scheduled, []) - - # Cause a paint to be scheduled. - root.repaint() - self.assertEqual(paints, []) - self.assertEqual(len(scheduled), 1) - - # Do another one to verify nothing else happens as long as the previous - # one is still pending. - root.repaint() - self.assertEqual(paints, []) - self.assertEqual(len(scheduled), 1) - - # Run the actual paint call. - scheduled.pop()() - self.assertEqual(len(paints), 1) - self.assertEqual(scheduled, []) - - # Do one more to verify that now that the previous one is finished - # future paints will succeed. - root.repaint() - self.assertEqual(len(paints), 1) - self.assertEqual(len(scheduled), 1) - - - -class ScrolledAreaTests(TestCase): - """ - Tests for L{ScrolledArea}, a widget which creates a viewport containing - another widget and can reposition that viewport using scrollbars. - """ - def test_parent(self): - """ - The parent of the widget passed to L{ScrolledArea} is set to a new - L{Viewport} created by the L{ScrolledArea} which itself has the - L{ScrolledArea} instance as its parent. - """ - widget = TextOutput() - scrolled = ScrolledArea(widget) - self.assertIdentical(widget.parent, scrolled._viewport) - self.assertIdentical(scrolled._viewport.parent, scrolled) |