def test_existing_path_FileLinks():
 td = mkdtemp()
 tf1 = NamedTemporaryFile(dir=td)
 tf2 = NamedTemporaryFile(dir=td)
 fl = display.FileLinks(td)
 actual = fl._repr_html_()
 actual = actual.split('\n')
 actual.sort()
 expected = [('%s/<br>' % td), ("&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" % (tf2.name.replace('\\', '/'), split(tf2.name)[1])), ("&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" % (tf1.name.replace('\\', '/'), split(tf1.name)[1]))]
 expected.sort()
 nt.assert_equal(actual, expected)

def test_existing_path_FileLinks ( ) : td = mkdtemp ( ) tf1 = NamedTemporaryFile ( dir = td ) tf2 = NamedTemporaryFile ( dir = td ) fl = display . FileLinks ( td ) actual = fl . _repr_html_ ( ) actual = actual . split ( '\n' ) actual . sort ( ) expected = [ ( '%s/<br>' % td ) , ( "&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" % ( tf2 . name . replace ( '\\' , '/' ) , split ( tf2 . name ) [ 1 ] ) ) , ( "&nbsp;&nbsp;<a href='%s' target='_blank'>%s</a><br>" % ( tf1 . name . replace ( '\\' , '/' ) , split ( tf1 . name ) [ 1 ] ) ) ] expected . sort ( ) nt . assert_equal ( actual , expected )
filelinks: calling _repr_html_ functions as expected on existing dir .