()
| 420 | |
| 421 | |
| 422 | def test_display_handle(): |
| 423 | ip = get_ipython() |
| 424 | handle = display.DisplayHandle() |
| 425 | nt.assert_is_instance(handle.display_id, str) |
| 426 | handle = display.DisplayHandle('my-id') |
| 427 | nt.assert_equal(handle.display_id, 'my-id') |
| 428 | with mock.patch.object(ip.display_pub, 'publish') as pub: |
| 429 | handle.display('x') |
| 430 | handle.update('y') |
| 431 | |
| 432 | args, kwargs = pub.call_args_list[0] |
| 433 | nt.assert_equal(args, ()) |
| 434 | nt.assert_equal(kwargs, { |
| 435 | 'data': { |
| 436 | 'text/plain': repr('x') |
| 437 | }, |
| 438 | 'metadata': {}, |
| 439 | 'transient': { |
| 440 | 'display_id': handle.display_id, |
| 441 | } |
| 442 | }) |
| 443 | args, kwargs = pub.call_args_list[1] |
| 444 | nt.assert_equal(args, ()) |
| 445 | nt.assert_equal(kwargs, { |
| 446 | 'data': { |
| 447 | 'text/plain': repr('y') |
| 448 | }, |
| 449 | 'metadata': {}, |
| 450 | 'transient': { |
| 451 | 'display_id': handle.display_id, |
| 452 | }, |
| 453 | 'update': True, |
| 454 | }) |
| 455 |
nothing calls this directly
no test coverage detected