()
| 558 | |
| 559 | |
| 560 | def test_repr_mime_meta(): |
| 561 | class HasReprMimeMeta(object): |
| 562 | def _repr_mimebundle_(self, include=None, exclude=None): |
| 563 | data = { |
| 564 | "image/png": "base64-image-data", |
| 565 | } |
| 566 | metadata = { |
| 567 | "image/png": { |
| 568 | "width": 5, |
| 569 | "height": 10, |
| 570 | } |
| 571 | } |
| 572 | return (data, metadata) |
| 573 | |
| 574 | f = get_ipython().display_formatter |
| 575 | obj = HasReprMimeMeta() |
| 576 | d, md = f.format(obj) |
| 577 | assert sorted(d) == ["image/png", "text/plain"] |
| 578 | assert md == { |
| 579 | "image/png": { |
| 580 | "width": 5, |
| 581 | "height": 10, |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | |
| 586 | def test_repr_mime_failure(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…