FileLinks: Calling _repr_html_ functions as expected w/ an alt formatter
()
| 118 | |
| 119 | |
| 120 | def test_existing_path_FileLinks_alt_formatter(): |
| 121 | """FileLinks: Calling _repr_html_ functions as expected w/ an alt formatter""" |
| 122 | td = mkdtemp() |
| 123 | tf1 = NamedTemporaryFile(dir=td) |
| 124 | tf2 = NamedTemporaryFile(dir=td) |
| 125 | |
| 126 | def fake_formatter(dirname, fnames, included_suffixes): |
| 127 | return ["hello", "world"] |
| 128 | |
| 129 | fl = display.FileLinks(td, notebook_display_formatter=fake_formatter) |
| 130 | actual = fl._repr_html_() |
| 131 | actual = actual.split("\n") |
| 132 | actual.sort() |
| 133 | expected = ["hello", "world"] |
| 134 | expected.sort() |
| 135 | # We compare the sorted list of links here as that's more reliable |
| 136 | assert actual == expected |
| 137 | |
| 138 | |
| 139 | def test_existing_path_FileLinks_repr(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…