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

Method test_get_region

Lib/idlelib/idle_test/test_format.py:436–451  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

434"""
435
436 def test_get_region(self):
437 get = self.formatter.get_region
438 text = self.text
439 eq = self.assertEqual
440
441 # Add selection.
442 text.tag_add('sel', '7.0', '10.0')
443 expected_lines = ['',
444 ' def compare(self):',
445 ' if a > b:',
446 '']
447 eq(get(), ('7.0', '10.0', '\n'.join(expected_lines), expected_lines))
448
449 # Remove selection.
450 text.tag_remove('sel', '1.0', 'end')
451 eq(get(), ('15.0', '16.0', '\n', ['', '']))
452
453 def test_set_region(self):
454 set_ = self.formatter.set_region

Callers

nothing calls this directly

Calls 5

eqFunction · 0.85
tag_addMethod · 0.80
getFunction · 0.50
joinMethod · 0.45
tag_removeMethod · 0.45

Tested by

no test coverage detected