##// END OF EJS Templates
Merge pull request #929 from juliantaylor/multiline-history...
Merge pull request #929 from juliantaylor/multiline-history some readline multiline-history fixes and tests * fixes crash when readline is absent (#911) * do not save input from e.g. raw_input in history * do not add empty or duplicate entries lines to the history. * add tests for _replace_rlhist_multiline * protect pyreadline from some incorrect assumptions of equivalence to regular readline closes gh-911

File last commit:

r4960:7dc06b6e
r5275:7c0ffa59 merge
Show More
test_kernelsession.py
26 lines | 791 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)