FileLinks: Calling _repr_html_ functions as expected on existing dir
()
| 95 | |
| 96 | |
| 97 | def test_existing_path_FileLinks(): |
| 98 | """FileLinks: Calling _repr_html_ functions as expected on existing dir""" |
| 99 | td = mkdtemp() |
| 100 | tf1 = NamedTemporaryFile(dir=td) |
| 101 | tf2 = NamedTemporaryFile(dir=td) |
| 102 | fl = display.FileLinks(td) |
| 103 | actual = fl._repr_html_() |
| 104 | actual = actual.split("\n") |
| 105 | actual.sort() |
| 106 | # the links should always have forward slashes, even on windows, so replace |
| 107 | # backslashes with forward slashes here |
| 108 | expected = [ |
| 109 | "%s/<br>" % td, |
| 110 | " <a href='%s' target='_blank'>%s</a><br>" |
| 111 | % (tf2.name.replace("\\", "/"), split(tf2.name)[1]), |
| 112 | " <a href='%s' target='_blank'>%s</a><br>" |
| 113 | % (tf1.name.replace("\\", "/"), split(tf1.name)[1]), |
| 114 | ] |
| 115 | expected.sort() |
| 116 | # We compare the sorted list of links here as that's more reliable |
| 117 | assert actual == expected |
| 118 | |
| 119 | |
| 120 | def test_existing_path_FileLinks_alt_formatter(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…