Show More
@@ -178,8 +178,5 b' class SessionManager(LoggingConfigurable):' | |||||
178 | """Deletes the row in the session database with given session_id""" |
|
178 | """Deletes the row in the session database with given session_id""" | |
179 | # Check that session exists before deleting |
|
179 | # Check that session exists before deleting | |
180 | model = self.get_session(id=session_id) |
|
180 | model = self.get_session(id=session_id) | |
181 | if model is None: |
|
|||
182 | raise TraitError("The session does not exist: %s" %session_id) |
|
|||
183 | else: |
|
|||
184 |
|
|
181 | self.cursor.execute("DELETE FROM session WHERE id=?", (session_id,)) | |
185 |
|
|
182 | self.connection.commit() |
@@ -1,11 +1,9 b'' | |||||
1 | """Tests for the session manager.""" |
|
1 | """Tests for the session manager.""" | |
2 |
|
2 | |||
3 | import os |
|
|||
4 |
|
||||
5 | from unittest import TestCase |
|
3 | from unittest import TestCase | |
6 | from tempfile import NamedTemporaryFile |
|
|||
7 |
|
4 | |||
8 | from IPython.utils.tempdir import TemporaryDirectory |
|
5 | from tornado import web | |
|
6 | ||||
9 | from IPython.utils.traitlets import TraitError |
|
7 | from IPython.utils.traitlets import TraitError | |
10 |
|
8 | |||
11 | from ..sessionmanager import SessionManager |
|
9 | from ..sessionmanager import SessionManager | |
@@ -82,5 +80,5 b' class TestSessionManager(TestCase):' | |||||
82 | sm = SessionManager() |
|
80 | sm = SessionManager() | |
83 | session_id = sm.get_session_id() |
|
81 | session_id = sm.get_session_id() | |
84 | sm.save_session(session_id=session_id, name='test.ipynb', path='/path/to/', kernel_id='5678', ws_url='ws_url') |
|
82 | sm.save_session(session_id=session_id, name='test.ipynb', path='/path/to/', kernel_id='5678', ws_url='ws_url') | |
85 |
self.assertRaises( |
|
83 | self.assertRaises(web.HTTPError, sm.delete_session, session_id='23424') # Bad keyword | |
86 |
|
84 |
General Comments 0
You need to be logged in to leave comments.
Login now