Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/twisted_8_1/twisted/conch/test/test_window.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 """
3 Tests for the insults windowing module, L{twisted.conch.insults.window}.
4 """
5
6 from twisted.trial.unittest import TestCase
7
8 from twisted.conch.insults.window import TopWindow
9
10
11 class TopWindowTests(TestCase):
12 """
13 Tests for L{TopWindow}, the root window container class.
14 """
15
16 def test_paintScheduling(self):
17 """
18 Verify that L{TopWindow.repaint} schedules an actual paint to occur
19 using the scheduling object passed to its initializer.
20 """
21 paints = []
22 scheduled = []
23 root = TopWindow(lambda: paints.append(None), scheduled.append)
24
25 # Nothing should have happened yet.
26 self.assertEqual(paints, [])
27 self.assertEqual(scheduled, [])
28
29 # Cause a paint to be scheduled.
30 root.repaint()
31 self.assertEqual(paints, [])
32 self.assertEqual(len(scheduled), 1)
33
34 # Do another one to verify nothing else happens as long as the previous
35 # one is still pending.
36 root.repaint()
37 self.assertEqual(paints, [])
38 self.assertEqual(len(scheduled), 1)
39
40 # Run the actual paint call.
41 scheduled.pop()()
42 self.assertEqual(len(paints), 1)
43 self.assertEqual(scheduled, [])
44
45 # Do one more to verify that now that the previous one is finished
46 # future paints will succeed.
47 root.repaint()
48 self.assertEqual(len(paints), 1)
49 self.assertEqual(len(scheduled), 1)
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/conch/test/test_userauth.py ('k') | third_party/twisted_8_1/twisted/conch/topfiles/NEWS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698