##// END OF EJS Templates
Add some unit tests for the new dictionary syntax for installing nbextensions
Jason Grout -
Show More
@@ -133,6 +133,8 b' class TestInstallNBExtension(TestCase):'
133 133 d = u'∂ir'
134 134 install_nbextension(pjoin(self.src, d))
135 135 self.assert_installed(self.files[-1])
136 install_nbextension({'test': pjoin(self.src, d)})
137 self.assert_installed(pjoin('test', u'∂ir2', u'ƒile2'))
136 138
137 139 def test_install_nbextension(self):
138 140 install_nbextension(glob.glob(pjoin(self.src, '*')))
@@ -240,6 +242,8 b' class TestInstallNBExtension(TestCase):'
240 242 self.assert_installed("foo.js")
241 243 install_nbextension("https://example.com/path/to/another/bar.js")
242 244 self.assert_installed("bar.js")
245 install_nbextension({'foobar.js': "https://example.com/path/to/another/bar.js"})
246 self.assert_installed("foobar.js")
243 247 finally:
244 248 nbextensions.urlretrieve = save_urlretrieve
245 249
@@ -250,10 +254,9 b' class TestInstallNBExtension(TestCase):'
250 254 touch(src)
251 255 install_nbextension(src, user=True)
252 256
253 nbext = pjoin(self.ipdir, u'nbextensions')
254 assert check_nbextension(f, nbext)
255 assert check_nbextension([f], nbext)
256 assert not check_nbextension([f, pjoin('dne', f)], nbext)
257 assert check_nbextension(f, user=True)
258 assert check_nbextension([f], user=True)
259 assert not check_nbextension([f, pjoin('dne', f)], user=True)
257 260
258 261 @dec.skip_win32
259 262 def test_install_symlink(self):
@@ -280,3 +283,11 b' class TestInstallNBExtension(TestCase):'
280 283 with self.assertRaises(ValueError):
281 284 install_nbextension(zsrc, symlink=True)
282 285
286 def test_install_different_name(self):
287 with TemporaryDirectory() as d:
288 f = u'ƒ.js'
289 src = pjoin(d, f)
290 dest_f = 'ƒile.js'
291 touch(src)
292 install_nbextension({dest_f: src})
293 self.assert_installed(dest_f)
General Comments 0
You need to be logged in to leave comments. Login now