##// END OF EJS Templates
Windows testing fixes
MinRK -
Show More
@@ -170,7 +170,11 b' class APITest(NotebookTestBase):'
170 location_header = py3compat.str_to_unicode(resp.headers['Location'])
170 location_header = py3compat.str_to_unicode(resp.headers['Location'])
171 self.assertEqual(location_header, url_escape(url_path_join(u'/api/notebooks', path, name)))
171 self.assertEqual(location_header, url_escape(url_path_join(u'/api/notebooks', path, name)))
172 self.assertEqual(resp.json()['name'], name)
172 self.assertEqual(resp.json()['name'], name)
173 assert os.path.isfile(pjoin(self.notebook_dir.name, path, name))
173 assert os.path.isfile(pjoin(
174 self.notebook_dir.name,
175 path.replace('/', os.path.sep),
176 name,
177 ))
174
178
175 def test_create_untitled(self):
179 def test_create_untitled(self):
176 resp = self.nb_api.create_untitled(path=u'å b')
180 resp = self.nb_api.create_untitled(path=u'å b')
@@ -182,7 +186,7 b' class APITest(NotebookTestBase):'
182
186
183 # And two directories down
187 # And two directories down
184 resp = self.nb_api.create_untitled(path='foo/bar')
188 resp = self.nb_api.create_untitled(path='foo/bar')
185 self._check_nb_created(resp, 'Untitled0.ipynb', pjoin('foo', 'bar'))
189 self._check_nb_created(resp, 'Untitled0.ipynb', 'foo/bar')
186
190
187 def test_upload_untitled(self):
191 def test_upload_untitled(self):
188 nb = new_notebook(name='Upload test')
192 nb = new_notebook(name='Upload test')
@@ -30,18 +30,17 b' class FilesTest(NotebookTestBase):'
30 path = pjoin(nbdir, d.replace('/', os.path.sep))
30 path = pjoin(nbdir, d.replace('/', os.path.sep))
31 if not os.path.exists(path):
31 if not os.path.exists(path):
32 os.mkdir(path)
32 os.mkdir(path)
33 with io.open(pjoin(path, 'foo'), 'w', encoding='utf8') as f:
33 with open(pjoin(path, 'foo'), 'w') as f:
34 f.write(path)
34 f.write('foo')
35 with io.open(pjoin(path, '.foo'), 'w', encoding='utf8') as f:
35 with open(pjoin(path, '.foo'), 'w') as f:
36 f.write(path + '.foo')
36 f.write('.foo')
37 url = self.base_url()
37 url = self.base_url()
38
38
39 for d in not_hidden:
39 for d in not_hidden:
40 path = pjoin(nbdir, d.replace('/', os.path.sep))
40 path = pjoin(nbdir, d.replace('/', os.path.sep))
41 r = requests.get(url_path_join(url, 'files', d, 'foo'))
41 r = requests.get(url_path_join(url, 'files', d, 'foo'))
42 r.raise_for_status()
42 r.raise_for_status()
43 reply = py3compat.cast_unicode(r.content)
43 self.assertEqual(r.content, u'foo')
44 self.assertEqual(normalize('NFC', path), normalize('NFC', reply))
45 r = requests.get(url_path_join(url, 'files', d, '.foo'))
44 r = requests.get(url_path_join(url, 'files', d, '.foo'))
46 self.assertEqual(r.status_code, 403)
45 self.assertEqual(r.status_code, 403)
47
46
General Comments 0
You need to be logged in to leave comments. Login now