From 39454923310ff66710b3b18d5a69510b9a2a36aa 2014-02-14 03:46:36 From: MinRK Date: 2014-02-14 03:46:36 Subject: [PATCH] test check_nbextension --- diff --git a/IPython/html/tests/test_nbextensions.py b/IPython/html/tests/test_nbextensions.py index 57c96ff..270b37b 100644 --- a/IPython/html/tests/test_nbextensions.py +++ b/IPython/html/tests/test_nbextensions.py @@ -24,7 +24,7 @@ import IPython.testing.tools as tt from IPython.utils import py3compat from IPython.utils.tempdir import TemporaryDirectory from IPython.html import nbextensions -from IPython.html.nbextensions import install_nbextension +from IPython.html.nbextensions import install_nbextension, check_nbextension #----------------------------------------------------------------------------- # Test functions @@ -232,3 +232,15 @@ class TestInstallNBExtension(TestCase): self.assert_installed("bar.js") finally: nbextensions.urlretrieve = save_urlretrieve + + def test_check_nbextension(self): + with TemporaryDirectory() as d: + f = u'ƒ.js' + src = pjoin(d, f) + touch(src) + install_nbextension(src) + + assert check_nbextension(f, self.ipdir) + assert check_nbextension([f], self.ipdir) + assert not check_nbextension([f, pjoin('dne', f)], self.ipdir) +