| 437 | |
| 438 | def test_repr_mime(): |
| 439 | class HasReprMime(object): |
| 440 | def _repr_mimebundle_(self, include=None, exclude=None): |
| 441 | return { |
| 442 | 'application/json+test.v2': { |
| 443 | 'x': 'y' |
| 444 | }, |
| 445 | 'plain/text' : '<HasReprMime>', |
| 446 | 'image/png' : 'i-overwrite' |
| 447 | } |
| 448 | |
| 449 | def _repr_png_(self): |
| 450 | return 'should-be-overwritten' |
| 451 | def _repr_html_(self): |
| 452 | return '<b>hi!</b>' |
| 453 | |
| 454 | f = get_ipython().display_formatter |
| 455 | html_f = f.formatters['text/html'] |
no outgoing calls