MCPcopy Create free account
hub / github.com/ipython/ipython / HasReprMime

Class HasReprMime

IPython/core/tests/test_formatters.py:439–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437
438def 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']

Callers 1

test_repr_mimeFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_repr_mimeFunction · 0.68