mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Merge pull request #3459 from takluyver/appveyor-path-fails
Undo patches in teardown before attempting to delete files
This commit is contained in:
commit
e433b81bcc
@ -178,9 +178,9 @@ class NotebookTestBase(TestCase):
|
||||
def teardown_class(cls):
|
||||
cls.notebook.stop()
|
||||
cls.wait_until_dead()
|
||||
cls.tmp_dir.cleanup()
|
||||
cls.env_patch.stop()
|
||||
cls.path_patch.stop()
|
||||
cls.tmp_dir.cleanup()
|
||||
# cleanup global zmq Context, to ensure we aren't leaving dangling sockets
|
||||
def cleanup_zmq():
|
||||
zmq.Context.instance().term()
|
||||
|
@ -4,6 +4,10 @@ import io
|
||||
from notebook.utils import url_path_join
|
||||
from nbformat import write
|
||||
from nbformat.v4 import new_notebook
|
||||
try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
|
||||
import requests
|
||||
|
||||
@ -28,5 +32,7 @@ class TreeTest(NotebookTestBase):
|
||||
r = self.request('GET', 'tree/foo/bar.ipynb')
|
||||
self.assertEqual(r.url, self.base_url() + 'notebooks/foo/bar.ipynb')
|
||||
|
||||
r = self.request('GET', 'tree/foo/baz.txt')
|
||||
self.assertEqual(r.url, url_path_join(self.base_url(), 'files/foo/baz.txt'))
|
||||
r = self.request('GET', 'tree/foo/baz.txt', allow_redirects=False)
|
||||
self.assertEqual(r.status_code, 302)
|
||||
self.assertEqual(r.headers['Location'],
|
||||
urlparse(url_path_join(self.base_url(), 'files/foo/baz.txt')).path)
|
||||
|
Loading…
Reference in New Issue
Block a user