MCPcopy Index your code
hub / github.com/python/cpython / test_scroll

Method test_scroll

Lib/idlelib/idle_test/test_sidebar.py:319–338  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

317 self.assertEqual(self.get_selection(), ('2.0', '5.0'))
318
319 def test_scroll(self):
320 self.linenumber.show_sidebar()
321 self.text.insert('1.0', 'line\n' * 100)
322 self.root.update()
323
324 # Scroll down 10 lines.
325 self.text.yview_scroll(10, 'unit')
326 self.root.update()
327 self.assertEqual(self.text.index('@0,0'), '11.0')
328 self.assertEqual(self.linenumber.sidebar_text.index('@0,0'), '11.0')
329
330 # Generate a mouse-wheel event and make sure it scrolled up or down.
331 # The meaning of the "delta" is OS-dependent, so this just checks for
332 # any change.
333 self.linenumber.sidebar_text.event_generate('<MouseWheel>',
334 x=0, y=0,
335 delta=10)
336 self.root.update()
337 self.assertNotEqual(self.text.index('@0,0'), '11.0')
338 self.assertNotEqual(self.linenumber.sidebar_text.index('@0,0'), '11.0')
339
340 def test_font(self):
341 ln = self.linenumber

Callers

nothing calls this directly

Calls 8

show_sidebarMethod · 0.80
yview_scrollMethod · 0.80
event_generateMethod · 0.80
assertNotEqualMethod · 0.80
insertMethod · 0.45
updateMethod · 0.45
assertEqualMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected