##// END OF EJS Templates
FileLink: add test with path-like object...
Cristian Ciupitu -
Show More
@@ -14,6 +14,11 b''
14 #-----------------------------------------------------------------------------
14 #-----------------------------------------------------------------------------
15 from tempfile import NamedTemporaryFile, mkdtemp
15 from tempfile import NamedTemporaryFile, mkdtemp
16 from os.path import split, join as pjoin, dirname
16 from os.path import split, join as pjoin, dirname
17 import sys
18 try:
19 import pathlib
20 except ImportError:
21 pass
17
22
18 # Third-party imports
23 # Third-party imports
19 import nose.tools as nt
24 import nose.tools as nt
@@ -33,6 +38,9 b' from IPython.testing.decorators import skipif_not_numpy'
33 def test_instantiation_FileLink():
38 def test_instantiation_FileLink():
34 """FileLink: Test class can be instantiated"""
39 """FileLink: Test class can be instantiated"""
35 fl = display.FileLink('example.txt')
40 fl = display.FileLink('example.txt')
41 # TODO: remove if when only Python >= 3.6 is supported
42 if sys.version_info >= (3, 6):
43 fl = display.FileLink(pathlib.PurePath('example.txt'))
36
44
37 def test_warning_on_non_existant_path_FileLink():
45 def test_warning_on_non_existant_path_FileLink():
38 """FileLink: Calling _repr_html_ on non-existant files returns a warning
46 """FileLink: Calling _repr_html_ on non-existant files returns a warning
General Comments 0
You need to be logged in to leave comments. Login now