MCPcopy Create free account
hub / github.com/ipython/ipython / test_update_display

Function test_update_display

IPython/core/tests/test_display.py:389–419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

387
388
389def test_update_display():
390 ip = get_ipython()
391 with mock.patch.object(ip.display_pub, 'publish') as pub:
392 with nt.assert_raises(TypeError):
393 display.update_display('x')
394 display.update_display('x', display_id='1')
395 display.update_display('y', display_id='2')
396 args, kwargs = pub.call_args_list[0]
397 nt.assert_equal(args, ())
398 nt.assert_equal(kwargs, {
399 'data': {
400 'text/plain': repr('x')
401 },
402 'metadata': {},
403 'transient': {
404 'display_id': '1',
405 },
406 'update': True,
407 })
408 args, kwargs = pub.call_args_list[1]
409 nt.assert_equal(args, ())
410 nt.assert_equal(kwargs, {
411 'data': {
412 'text/plain': repr('y')
413 },
414 'metadata': {},
415 'transient': {
416 'display_id': '2',
417 },
418 'update': True,
419 })
420
421
422def test_display_handle():

Callers

nothing calls this directly

Calls 1

get_ipythonFunction · 0.90

Tested by

no test coverage detected