/usr/lib/python3/dist-packages/twisted/conch/test
NameSizeModeActions
__pycache__/-0755rm
keydata.py271100644editdlrm
loopback.py7570644editdlrm
test_address.py16290644editdlrm
test_agent.py130860644editdlrm
test_cftp.py508960644editdlrm
test_channel.py120990644editdlrm
test_checkers.py314980644editdlrm
test_ckeygen.py202810644editdlrm
test_conch.py251400644editdlrm
test_connection.py281490644editdlrm
test_default.py115840644editdlrm
test_endpoints.py545610644editdlrm
test_filetransfer.py292390644editdlrm
test_forwarding.py22160644editdlrm
test_helper.py204920644editdlrm
test_insults.py335810644editdlrm
test_keys.py485740644editdlrm
test_knownhosts.py493980644editdlrm
test_manhole.py134620644editdlrm
test_manhole_tap.py42350644editdlrm
test_mixin.py10550644editdlrm
test_openssh_compat.py46300644editdlrm
test_recvline.py254060644editdlrm
test_scripts.py18870644editdlrm
test_session.py394640644editdlrm
test_ssh.py323770644editdlrm
test_tap.py49510644editdlrm
test_telnet.py265240644editdlrm
test_text.py39430644editdlrm
test_transport.py939880644editdlrm
test_unix.py25330644editdlrm
test_userauth.py326040644editdlrm
test_window.py21150644editdlrm
__init__.py140644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/conch/test/test_window.py (2115B)
""" 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.assertIs(widget.parent, scrolled._viewport) self.assertIs(scrolled._viewport.parent, scrolled)