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

Method test_embedded_null

Lib/test/test_tkinter/test_misc.py:504–511  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

502 self.assertStartsWith(str(vi), f'{vi.major}.{vi.minor}')
503
504 def test_embedded_null(self):
505 widget = tkinter.Entry(self.root)
506 widget.insert(0, 'abc\0def') # ASCII-only
507 widget.selection_range(0, 'end')
508 self.assertEqual(widget.selection_get(), 'abc\x00def')
509 widget.insert(0, '\u20ac\0') # non-ASCII
510 widget.selection_range(0, 'end')
511 self.assertEqual(widget.selection_get(), '\u20ac\0abc\x00def')
512
513 def test_iterable_protocol(self):
514 widget = tkinter.Entry(self.root)

Callers

nothing calls this directly

Calls 4

insertMethod · 0.95
selection_rangeMethod · 0.95
selection_getMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected