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

Function test_existing_path_FileLinks_repr

IPython/lib/tests/test_display.py:133–145  ·  view source on GitHub ↗

FileLinks: Calling repr() functions as expected on existing directory

()

Source from the content-addressed store, hash-verified

131 nt.assert_equal(actual,expected)
132
133def test_existing_path_FileLinks_repr():
134 """FileLinks: Calling repr() functions as expected on existing directory """
135 td = mkdtemp()
136 tf1 = NamedTemporaryFile(dir=td)
137 tf2 = NamedTemporaryFile(dir=td)
138 fl = display.FileLinks(td)
139 actual = repr(fl)
140 actual = actual.split('\n')
141 actual.sort()
142 expected = ['%s/' % td, ' %s' % split(tf1.name)[1],' %s' % split(tf2.name)[1]]
143 expected.sort()
144 # We compare the sorted list of links here as that's more reliable
145 nt.assert_equal(actual,expected)
146
147def test_existing_path_FileLinks_repr_alt_formatter():
148 """FileLinks: Calling repr() functions as expected w/ alt formatter

Callers

nothing calls this directly

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected