From a3d71afaab7527eb447fff3756ee49a7e9212bad 2014-04-21 23:48:30 From: Jessica B. Hamrick Date: 2014-04-21 23:48:30 Subject: [PATCH] Add test for DisplayObject.__repr__ --- diff --git a/IPython/core/tests/test_display.py b/IPython/core/tests/test_display.py index 8e55cc0..d44a249 100644 --- a/IPython/core/tests/test_display.py +++ b/IPython/core/tests/test_display.py @@ -116,3 +116,19 @@ def test_set_matplotlib_formats_kwargs(): expected.update(cfg.print_figure_kwargs) nt.assert_equal(cell, expected) +def test_displayobject_repr(): + h = display.HTML('
') + nt.assert_equal(repr(h), '') + h._show_mem_addr = True + nt.assert_equal( + repr(h), '' % hex(id(h))) + h._show_mem_addr = False + nt.assert_equal(repr(h), '') + + j = display.Javascript('') + nt.assert_equal(repr(j), '') + j._show_mem_addr = True + nt.assert_equal( + repr(j), '' % hex(id(j))) + j._show_mem_addr = False + nt.assert_equal(repr(j), '')