MCPcopy Index your code
hub / github.com/ipython/ipython / test_display_handle

Function test_display_handle

tests/test_display_2.py:510–538  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

508
509
510def test_display_handle():
511 ip = get_ipython()
512 handle = display.DisplayHandle()
513 assert isinstance(handle.display_id, str)
514 handle = display.DisplayHandle("my-id")
515 assert handle.display_id == "my-id"
516 with mock.patch.object(ip.display_pub, "publish") as pub:
517 handle.display("x")
518 handle.update("y")
519
520 args, kwargs = pub.call_args_list[0]
521 assert args == ()
522 assert kwargs == {
523 "data": {"text/plain": repr("x")},
524 "metadata": {},
525 "transient": {
526 "display_id": handle.display_id,
527 },
528 }
529 args, kwargs = pub.call_args_list[1]
530 assert args == ()
531 assert kwargs == {
532 "data": {"text/plain": repr("y")},
533 "metadata": {},
534 "transient": {
535 "display_id": handle.display_id,
536 },
537 "update": True,
538 }
539
540
541def test_image_alt_tag():

Callers

nothing calls this directly

Calls 3

displayMethod · 0.95
updateMethod · 0.95
get_ipythonFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…