Show More
@@ -1,5 +1,6 b'' | |||
|
1 | 1 | """Test the sessions web service API.""" |
|
2 | 2 | |
|
3 | import errno | |
|
3 | 4 | import io |
|
4 | 5 | import os |
|
5 | 6 | import json |
@@ -51,7 +52,12 b' class SessionAPITest(NotebookTestBase):' | |||
|
51 | 52 | """Test the sessions web service API""" |
|
52 | 53 | def setUp(self): |
|
53 | 54 | nbdir = self.notebook_dir.name |
|
54 | os.mkdir(pjoin(nbdir, 'foo')) | |
|
55 | try: | |
|
56 | os.mkdir(pjoin(nbdir, 'foo')) | |
|
57 | except OSError as e: | |
|
58 | # Deleting the folder in an earlier test may have failed | |
|
59 | if e.errno != errno.EEXIST: | |
|
60 | raise | |
|
55 | 61 | |
|
56 | 62 | with io.open(pjoin(nbdir, 'foo', 'nb1.ipynb'), 'w') as f: |
|
57 | 63 | nb = new_notebook(name='nb1') |
@@ -62,7 +68,8 b' class SessionAPITest(NotebookTestBase):' | |||
|
62 | 68 | def tearDown(self): |
|
63 | 69 | for session in self.sess_api.list().json(): |
|
64 | 70 | self.sess_api.delete(session['id']) |
|
65 |
shutil.rmtree(pjoin(self.notebook_dir.name, 'foo') |
|
|
71 | shutil.rmtree(pjoin(self.notebook_dir.name, 'foo'), | |
|
72 | ignore_errors=True) | |
|
66 | 73 | |
|
67 | 74 | def test_create(self): |
|
68 | 75 | sessions = self.sess_api.list().json() |
General Comments 0
You need to be logged in to leave comments.
Login now