def test_existing_path_FileLinks_repr():
 td = mkdtemp()
 tf1 = NamedTemporaryFile(dir=td)
 tf2 = NamedTemporaryFile(dir=td)
 fl = display.FileLinks(td)
 actual = repr(fl)
 actual = actual.split('\n')
 actual.sort()
 expected = [('%s/' % td), ('  %s' % split(tf1.name)[1]), ('  %s' % split(tf2.name)[1])]
 expected.sort()
 nt.assert_equal(actual, expected)

def test_existing_path_FileLinks_repr ( ) : td = mkdtemp ( ) tf1 = NamedTemporaryFile ( dir = td ) tf2 = NamedTemporaryFile ( dir = td ) fl = display . FileLinks ( td ) actual = repr ( fl ) actual = actual . split ( '\n' ) actual . sort ( ) expected = [ ( '%s/' % td ) , ( '  %s' % split ( tf1 . name ) [ 1 ] ) , ( '  %s' % split ( tf2 . name ) [ 1 ] ) ] expected . sort ( ) nt . assert_equal ( actual , expected )
filelinks: calling repr() functions as expected on existing directory .