()
| 498 | |
| 499 | |
| 500 | def test_repr_mime_meta(): |
| 501 | class HasReprMimeMeta(object): |
| 502 | def _repr_mimebundle_(self, include=None, exclude=None): |
| 503 | data = { |
| 504 | 'image/png': 'base64-image-data', |
| 505 | } |
| 506 | metadata = { |
| 507 | 'image/png': { |
| 508 | 'width': 5, |
| 509 | 'height': 10, |
| 510 | } |
| 511 | } |
| 512 | return (data, metadata) |
| 513 | |
| 514 | f = get_ipython().display_formatter |
| 515 | obj = HasReprMimeMeta() |
| 516 | d, md = f.format(obj) |
| 517 | nt.assert_equal(sorted(d), ['image/png', 'text/plain']) |
| 518 | nt.assert_equal(md, { |
| 519 | 'image/png': { |
| 520 | 'width': 5, |
| 521 | 'height': 10, |
| 522 | } |
| 523 | }) |
| 524 | |
| 525 | def test_repr_mime_failure(): |
| 526 | class BadReprMime(object): |
nothing calls this directly
no test coverage detected