/usr/lib/python3/dist-packages/twisted/conch/test
NameSizeModeActions
__pycache__/-0755rm
keydata.py352080644editdlrm
loopback.py7060644editdlrm
test_address.py15500644editdlrm
test_agent.py132190644editdlrm
test_cftp.py505030644editdlrm
test_channel.py121830644editdlrm
test_checkers.py313400644editdlrm
test_ckeygen.py243390644editdlrm
test_conch.py257400644editdlrm
test_connection.py292570644editdlrm
test_default.py115880644editdlrm
test_endpoints.py558880644editdlrm
test_filetransfer.py331330644editdlrm
test_forwarding.py21620644editdlrm
test_helper.py200330644editdlrm
test_insults.py321320644editdlrm
test_keys.py625190644editdlrm
test_knownhosts.py494970644editdlrm
test_manhole.py132570644editdlrm
test_manhole_tap.py43510644editdlrm
test_mixin.py10540644editdlrm
test_openssh_compat.py48760644editdlrm
test_recvline.py254320644editdlrm
test_scripts.py17810644editdlrm
test_session.py447930644editdlrm
test_ssh.py329380644editdlrm
test_tap.py50370644editdlrm
test_telnet.py268070644editdlrm
test_text.py40210644editdlrm
test_transport.py1072710644editdlrm
test_unix.py26000644editdlrm
test_userauth.py335550644editdlrm
test_window.py21130644editdlrm
__init__.py140644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/conch/test/test_window.py (2113B)
""" Tests for the insults windowing module, L{twisted.conch.insults.window}. """ from twisted.conch.insults.window import ScrolledArea, TextOutput, TopWindow from twisted.trial.unittest import TestCase 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.assertIs(widget.parent, scrolled._viewport) self.assertIs(scrolled._viewport.parent, scrolled)