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

Method test_make_callback

Lib/idlelib/idle_test/test_configdialog.py:1535–1545  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1533 del tr.make_callback
1534
1535 def test_make_callback(self):
1536 cb = self.tracers.make_callback(self.iv, ('main', 'section', 'option'))
1537 self.assertTrue(callable(cb))
1538 self.iv.set(42)
1539 # Not attached, so set didn't invoke the callback.
1540 self.assertNotIn('section', changes['main'])
1541 # Invoke callback manually.
1542 cb()
1543 self.assertIn('section', changes['main'])
1544 self.assertEqual(changes['main']['section']['option'], '42')
1545 changes.clear()
1546
1547 def test_attach_detach(self):
1548 tr = self.tracers

Callers

nothing calls this directly

Calls 8

cbFunction · 0.85
make_callbackMethod · 0.80
assertTrueMethod · 0.80
assertNotInMethod · 0.80
assertInMethod · 0.80
setMethod · 0.45
assertEqualMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected