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

Method test_selection_methods

Lib/test/test_tkinter/test_widgets.py:595–617  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

593 self.assertRaises(TypeError, widget.bbox, 0, 1)
594
595 def test_selection_methods(self):
596 widget = self.create()
597 widget.insert(0, '12345')
598 self.assertFalse(widget.selection_present())
599 widget.selection_range(0, 'end')
600 self.assertEqual(widget.selection_get(), '12345')
601 self.assertTrue(widget.selection_present())
602 widget.selection_from(1)
603 widget.selection_to(2)
604 self.assertEqual(widget.selection_get(), '2')
605 widget.selection_range(3, 4)
606 self.assertEqual(widget.selection_get(), '4')
607 widget.selection_clear()
608 self.assertFalse(widget.selection_present())
609 widget.selection_range(0, 'end')
610 widget.selection_adjust(4)
611 self.assertEqual(widget.selection_get(), '1234')
612 widget.selection_adjust(1)
613 self.assertEqual(widget.selection_get(), '234')
614 widget.selection_adjust(5)
615 self.assertEqual(widget.selection_get(), '2345')
616 widget.selection_adjust(0)
617 self.assertEqual(widget.selection_get(), '12345')
618
619 def test_selection_element(self):
620 widget = self.create()

Callers

nothing calls this directly

Calls 12

createMethod · 0.95
assertFalseMethod · 0.80
selection_getMethod · 0.80
assertTrueMethod · 0.80
insertMethod · 0.45
selection_presentMethod · 0.45
selection_rangeMethod · 0.45
assertEqualMethod · 0.45
selection_fromMethod · 0.45
selection_toMethod · 0.45
selection_clearMethod · 0.45
selection_adjustMethod · 0.45

Tested by

no test coverage detected