MCPcopy Index your code
hub / github.com/ipython/ipython / test_existing_path_FileLinks_repr_alt_formatter

Function test_existing_path_FileLinks_repr_alt_formatter

tests/test_display.py:154–170  ·  view source on GitHub ↗

FileLinks: Calling repr() functions as expected w/ alt formatter

()

Source from the content-addressed store, hash-verified

152
153
154def test_existing_path_FileLinks_repr_alt_formatter():
155 """FileLinks: Calling repr() functions as expected w/ alt formatter"""
156 td = mkdtemp()
157 tf1 = NamedTemporaryFile(dir=td)
158 tf2 = NamedTemporaryFile(dir=td)
159
160 def fake_formatter(dirname, fnames, included_suffixes):
161 return ["hello", "world"]
162
163 fl = display.FileLinks(td, terminal_display_formatter=fake_formatter)
164 actual = repr(fl)
165 actual = actual.split("\n")
166 actual.sort()
167 expected = ["hello", "world"]
168 expected.sort()
169 # We compare the sorted list of links here as that's more reliable
170 assert actual == expected
171
172
173def test_error_on_file_to_FileLinks():

Callers

nothing calls this directly

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…