FileLinks: Calling repr() functions as expected on existing directory
()
| 131 | nt.assert_equal(actual,expected) |
| 132 | |
| 133 | def 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 | |
| 147 | def test_existing_path_FileLinks_repr_alt_formatter(): |
| 148 | """FileLinks: Calling repr() functions as expected w/ alt formatter |