Simple test for display.Image(args, width=x,height=y)
()
| 19 | import IPython.testing.decorators as dec |
| 20 | |
| 21 | def 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 | |
| 36 | def test_image_mimes(): |
nothing calls this directly
no test coverage detected