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

Method test_selection_methods

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

Source from the content-addressed store, hash-verified

452 self.checkCommandParam(widget, 'vcmd')
453
454 def test_selection_methods(self):
455 widget = self.create()
456 widget.insert(0, '12345')
457 self.assertFalse(widget.selection_present())
458 widget.selection_range(0, 'end')
459 self.assertEqual(widget.selection_get(), '12345')
460 self.assertTrue(widget.selection_present())
461 widget.selection_from(1)
462 widget.selection_to(2)
463 self.assertEqual(widget.selection_get(), '2')
464 widget.selection_range(3, 4)
465 self.assertEqual(widget.selection_get(), '4')
466 widget.selection_clear()
467 self.assertFalse(widget.selection_present())
468 widget.selection_range(0, 'end')
469 widget.selection_adjust(4)
470 self.assertEqual(widget.selection_get(), '1234')
471 widget.selection_adjust(1)
472 self.assertEqual(widget.selection_get(), '234')
473 widget.selection_adjust(5)
474 self.assertEqual(widget.selection_get(), '2345')
475 widget.selection_adjust(0)
476 self.assertEqual(widget.selection_get(), '12345')
477 widget.selection_adjust(0)
478
479
480@add_configure_tests(StandardOptionsTests)

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