From 7cb4321bfe56adb4f19f80796713c25f14e0f4c1 Mon Sep 17 00:00:00 2001 From: MinRK Date: Wed, 5 Feb 2014 15:43:00 -0800 Subject: [PATCH] test unicode path in dashboard_nav --- IPython/html/tests/tree/dashboard_nav.js | 9 ++++++--- IPython/testing/iptestcontroller.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/IPython/html/tests/tree/dashboard_nav.js b/IPython/html/tests/tree/dashboard_nav.js index 0eebe4dae..6d046aeea 100644 --- a/IPython/html/tests/tree/dashboard_nav.js +++ b/IPython/html/tests/tree/dashboard_nav.js @@ -18,9 +18,12 @@ casper.test_items = function (baseUrl) { if (!item.label.match('.ipynb$')) { var followed_url = baseUrl+item.link; if (!followed_url.match('/\.\.$')) { - casper.thenOpen(baseUrl+item.link, function () { + casper.thenOpen(followed_url, function () { casper.wait_for_dashboard(); - this.test.assertEquals(this.getCurrentUrl(), followed_url, 'Testing dashboard link: '+followed_url); + // getCurrentUrl is with host, and url-decoded, + // but item.link is without host, and url-encoded + var expected = baseUrl + decodeURIComponent(item.link); + this.test.assertEquals(this.getCurrentUrl(), expected, 'Testing dashboard link: ' + expected); casper.test_items(baseUrl); this.back(); }); @@ -31,7 +34,7 @@ casper.test_items = function (baseUrl) { } casper.dashboard_test(function () { - baseUrl = this.get_notebook_server() + baseUrl = this.get_notebook_server(); casper.test_items(baseUrl); }) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 72412de0f..39fb93339 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -181,8 +181,8 @@ class JSController(TestController): self.ipydir = TemporaryDirectory() self.nbdir = TemporaryDirectory() print("Running notebook tests in directory: %r" % self.nbdir.name) - os.makedirs(os.path.join(self.nbdir.name, os.path.join('subdir1', 'subdir1a'))) - os.makedirs(os.path.join(self.nbdir.name, os.path.join('subdir2', 'subdir2a'))) + os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir1', u'sub ∂ir 1a'))) + os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir2', u'sub ∂ir 1b'))) self.dirs.append(self.ipydir) self.dirs.append(self.nbdir)