def test_existing_path_FileLinks_alt_formatter():
 td = mkdtemp()
 tf1 = NamedTemporaryFile(dir=td)
 tf2 = NamedTemporaryFile(dir=td)
 def fake_formatter(dirname, fnames, included_suffixes):
  return ['hello', 'world']
 fl = display.FileLinks(td, notebook_display_formatter=fake_formatter)
 actual = fl._repr_html_()
 actual = actual.split('\n')
 actual.sort()
 expected = ['hello', 'world']
 expected.sort()
 nt.assert_equal(actual, expected)

def test_existing_path_FileLinks_alt_formatter ( ) : td = mkdtemp ( ) tf1 = NamedTemporaryFile ( dir = td ) tf2 = NamedTemporaryFile ( dir = td ) def fake_formatter ( dirname , fnames , included_suffixes ) : return [ 'hello' , 'world' ] fl = display . FileLinks ( td , notebook_display_formatter = fake_formatter ) actual = fl . _repr_html_ ( ) actual = actual . split ( '\n' ) actual . sort ( ) expected = [ 'hello' , 'world' ] expected . sort ( ) nt . assert_equal ( actual , expected )
filelinks: calling _repr_html_ functions as expected w/ an alt formatter .