test unicode path in dashboard_nav

This commit is contained in:
MinRK 2014-02-05 15:43:00 -08:00
parent 13fc9022d9
commit 7cb4321bfe
2 changed files with 8 additions and 5 deletions

View File

@ -18,9 +18,12 @@ casper.test_items = function (baseUrl) {
if (!item.label.match('.ipynb$')) { if (!item.label.match('.ipynb$')) {
var followed_url = baseUrl+item.link; var followed_url = baseUrl+item.link;
if (!followed_url.match('/\.\.$')) { if (!followed_url.match('/\.\.$')) {
casper.thenOpen(baseUrl+item.link, function () { casper.thenOpen(followed_url, function () {
casper.wait_for_dashboard(); 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); casper.test_items(baseUrl);
this.back(); this.back();
}); });
@ -31,7 +34,7 @@ casper.test_items = function (baseUrl) {
} }
casper.dashboard_test(function () { casper.dashboard_test(function () {
baseUrl = this.get_notebook_server() baseUrl = this.get_notebook_server();
casper.test_items(baseUrl); casper.test_items(baseUrl);
}) })

View File

@ -181,8 +181,8 @@ class JSController(TestController):
self.ipydir = TemporaryDirectory() self.ipydir = TemporaryDirectory()
self.nbdir = TemporaryDirectory() self.nbdir = TemporaryDirectory()
print("Running notebook tests in directory: %r" % self.nbdir.name) 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(u'sub ∂ir1', u'sub ∂ir 1a')))
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 ∂ir2', u'sub ∂ir 1b')))
self.dirs.append(self.ipydir) self.dirs.append(self.ipydir)
self.dirs.append(self.nbdir) self.dirs.append(self.nbdir)