##// END OF EJS Templates
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown....
Backport PR #2773: Fixed minor typo causing AttributeError to be thrown. I'm not sure how I caused the error to be thrown and couldn't reproduce it with the same call again, nevertheless I think the fix is correct. ```python In [21]: rc.shutdown(hub=True) Traceback (most recent call last): File "<ipython-input-21-977a05a15f31>", line 1, in <module> rc.shutdown(hub=True) File "<string>", line 2, in shutdown File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 69, in spin_first self.spin() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 1005, in spin self._flush_notifications() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 800, in _flush_notifications raise Exception("Unhandled message type: %s"%msg.msg_type) AttributeError: 'dict' object has no attribute 'msg_type' ```

File last commit:

r5629:ba0b0dbd
r9855:7ad908bf
Show More
test_kernelsession.py
27 lines | 819 B | text/x-python | PythonLexer
"""Tests for the notebook kernel and session manager."""
from unittest import TestCase
from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager
class TestKernelManager(TestCase):
def test_km_lifecycle(self):
km = MultiKernelManager()
kid = km.start_kernel()
self.assert_(kid in km)
self.assertEquals(len(km),1)
km.kill_kernel(kid)
self.assert_(not kid in km)
kid = km.start_kernel()
self.assertEquals('127.0.0.1',km.get_kernel_ip(kid))
port_dict = km.get_kernel_ports(kid)
self.assert_('stdin_port' in port_dict)
self.assert_('iopub_port' in port_dict)
self.assert_('shell_port' in port_dict)
self.assert_('hb_port' in port_dict)
km.get_kernel(kid)
km.kill_kernel(kid)