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

Method test_copy

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

Source from the content-addressed store, hash-verified

711
712 @run_in_tk_mainloop()
713 def test_copy(self):
714 sidebar = self.shell.shell_sidebar
715 text = self.shell.text
716
717 first_line = get_end_linenumber(text)
718
719 self.do_input(dedent('''\
720 if True:
721 print(1)
722
723 '''))
724 yield
725
726 text.tag_add('sel', f'{first_line}.0', 'end-1c')
727 selected_text = text.get('sel.first', 'sel.last')
728 self.assertStartsWith(selected_text, 'if True:\n')
729 self.assertIn('\n1\n', selected_text)
730
731 text.event_generate('<<copy>>')
732 self.addCleanup(text.clipboard_clear)
733
734 copied_text = text.clipboard_get()
735 self.assertEqual(copied_text, selected_text)
736
737 @run_in_tk_mainloop()
738 def test_copy_with_prompts(self):

Callers

nothing calls this directly

Calls 11

do_inputMethod · 0.95
get_end_linenumberFunction · 0.90
dedentFunction · 0.90
tag_addMethod · 0.80
assertStartsWithMethod · 0.80
assertInMethod · 0.80
event_generateMethod · 0.80
addCleanupMethod · 0.80
clipboard_getMethod · 0.80
getMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected