diff --git a/IPython/lib/tests/test_display.py b/IPython/lib/tests/test_display.py index 95612d0..49fff83 100644 --- a/IPython/lib/tests/test_display.py +++ b/IPython/lib/tests/test_display.py @@ -47,6 +47,14 @@ def test_existing_path_FileLink(): expected = "%s
" % (tf.name,tf.name) nt.assert_equal(actual,expected) +def test_existing_path_FileLink_repr(): + """ Calling repr() functions as expected on existing filepath """ + tf = NamedTemporaryFile() + fl = display.FileLink(tf.name) + actual = repr(fl) + expected = tf.name + nt.assert_equal(actual,expected) + #-------------------------- # FileLinks tests #-------------------------- @@ -75,6 +83,20 @@ def test_existing_path_FileLinks(): # We compare the sorted list of links here as that's more reliable nt.assert_equal(actual,expected) +def test_existing_path_FileLinks_repr(): + """ Calling repr() functions as expected on existing directory """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + tf2 = NamedTemporaryFile(dir=td) + fl = display.FileLinks(td) + actual = repr(fl) + actual = actual.split('\n') + actual.sort() + expected = [tf1.name,tf2.name] + expected.sort() + # We compare the sorted list of links here as that's more reliable + nt.assert_equal(actual,expected) + #-------------------------- # DirectoryLink tests #--------------------------