MCPcopy Create free account
hub / github.com/ipython/ipython / test_existing_path_FileLink

Function test_existing_path_FileLink

IPython/lib/tests/test_display.py:56–63  ·  view source on GitHub ↗

FileLink: Calling _repr_html_ functions as expected on existing filepath

()

Source from the content-addressed store, hash-verified

54 nt.assert_true(fl._repr_html_().startswith('Path (<tt>example.txt</tt>)'))
55
56def test_existing_path_FileLink():
57 """FileLink: Calling _repr_html_ functions as expected on existing filepath
58 """
59 tf = NamedTemporaryFile()
60 fl = display.FileLink(tf.name)
61 actual = fl._repr_html_()
62 expected = "<a href='%s' target='_blank'>%s</a><br>" % (tf.name,tf.name)
63 nt.assert_equal(actual,expected)
64
65def test_existing_path_FileLink_repr():
66 """FileLink: Calling repr() functions as expected on existing filepath

Callers

nothing calls this directly

Calls 1

_repr_html_Method · 0.95

Tested by

no test coverage detected