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

Function test_image_size

IPython/core/tests/test_display.py:21–33  ·  view source on GitHub ↗

Simple test for display.Image(args, width=x,height=y)

()

Source from the content-addressed store, hash-verified

19import IPython.testing.decorators as dec
20
21def test_image_size():
22 """Simple test for display.Image(args, width=x,height=y)"""
23 thisurl = 'http://www.google.fr/images/srpr/logo3w.png'
24 img = display.Image(url=thisurl, width=200, height=200)
25 nt.assert_equal(u'<img src="%s" width="200" height="200"/>' % (thisurl), img._repr_html_())
26 img = display.Image(url=thisurl, metadata={'width':200, 'height':200})
27 nt.assert_equal(u'<img src="%s" width="200" height="200"/>' % (thisurl), img._repr_html_())
28 img = display.Image(url=thisurl, width=200)
29 nt.assert_equal(u'<img src="%s" width="200"/>' % (thisurl), img._repr_html_())
30 img = display.Image(url=thisurl)
31 nt.assert_equal(u'<img src="%s"/>' % (thisurl), img._repr_html_())
32 img = display.Image(url=thisurl, unconfined=True)
33 nt.assert_equal(u'<img src="%s" class="unconfined"/>' % (thisurl), img._repr_html_())
34
35
36def test_image_mimes():

Callers

nothing calls this directly

Calls 1

_repr_html_Method · 0.95

Tested by

no test coverage detected