FileLinks: Calling repr() functions as expected w/ alt formatter
()
| 152 | |
| 153 | |
| 154 | def 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 | |
| 173 | def test_error_on_file_to_FileLinks(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…