()
| 441 | |
| 442 | |
| 443 | def test_display_id(): |
| 444 | ip = get_ipython() |
| 445 | with mock.patch.object(ip.display_pub, "publish") as pub: |
| 446 | handle = display.display("x") |
| 447 | assert handle is None |
| 448 | handle = display.display("y", display_id="secret") |
| 449 | assert isinstance(handle, display.DisplayHandle) |
| 450 | handle2 = display.display("z", display_id=True) |
| 451 | assert isinstance(handle2, display.DisplayHandle) |
| 452 | assert handle.display_id != handle2.display_id |
| 453 | |
| 454 | assert pub.call_count == 3 |
| 455 | args, kwargs = pub.call_args_list[0] |
| 456 | assert args == () |
| 457 | assert kwargs == { |
| 458 | "data": {"text/plain": repr("x")}, |
| 459 | "metadata": {}, |
| 460 | } |
| 461 | args, kwargs = pub.call_args_list[1] |
| 462 | assert args == () |
| 463 | assert kwargs == { |
| 464 | "data": {"text/plain": repr("y")}, |
| 465 | "metadata": {}, |
| 466 | "transient": { |
| 467 | "display_id": handle.display_id, |
| 468 | }, |
| 469 | } |
| 470 | args, kwargs = pub.call_args_list[2] |
| 471 | assert args == () |
| 472 | assert kwargs == { |
| 473 | "data": {"text/plain": repr("z")}, |
| 474 | "metadata": {}, |
| 475 | "transient": { |
| 476 | "display_id": handle2.display_id, |
| 477 | }, |
| 478 | } |
| 479 | |
| 480 | |
| 481 | def test_update_display(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…