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