Show More
@@ -1,26 +1,27 b'' | |||||
1 | """Tests for the notebook kernel and session manager.""" |
|
1 | """Tests for the notebook kernel and session manager.""" | |
2 |
|
2 | |||
3 | from unittest import TestCase |
|
3 | from unittest import TestCase | |
4 |
|
4 | |||
5 | from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager |
|
5 | from IPython.frontend.html.notebook.kernelmanager import MultiKernelManager | |
6 |
|
6 | |||
7 | class TestKernelManager(TestCase): |
|
7 | class TestKernelManager(TestCase): | |
8 |
|
8 | |||
9 | def test_km_lifecycle(self): |
|
9 | def test_km_lifecycle(self): | |
10 | km = MultiKernelManager() |
|
10 | km = MultiKernelManager() | |
11 | kid = km.start_kernel() |
|
11 | kid = km.start_kernel() | |
12 | self.assert_(kid in km) |
|
12 | self.assert_(kid in km) | |
13 | self.assertEquals(len(km),1) |
|
13 | self.assertEquals(len(km),1) | |
14 | km.kill_kernel(kid) |
|
14 | km.kill_kernel(kid) | |
15 | self.assert_(not kid in km) |
|
15 | self.assert_(not kid in km) | |
16 |
|
16 | |||
17 | kid = km.start_kernel() |
|
17 | kid = km.start_kernel() | |
18 | self.assertEquals('127.0.0.1',km.get_kernel_ip(kid)) |
|
18 | self.assertEquals('127.0.0.1',km.get_kernel_ip(kid)) | |
19 | port_dict = km.get_kernel_ports(kid) |
|
19 | port_dict = km.get_kernel_ports(kid) | |
20 | self.assert_('stdin_port' in port_dict) |
|
20 | self.assert_('stdin_port' in port_dict) | |
21 | self.assert_('iopub_port' in port_dict) |
|
21 | self.assert_('iopub_port' in port_dict) | |
22 | self.assert_('shell_port' in port_dict) |
|
22 | self.assert_('shell_port' in port_dict) | |
23 | self.assert_('hb_port' in port_dict) |
|
23 | self.assert_('hb_port' in port_dict) | |
24 | km.get_kernel(kid) |
|
24 | km.get_kernel(kid) | |
|
25 | km.kill_kernel(kid) | |||
25 |
|
26 | |||
26 |
|
27 |
General Comments 0
You need to be logged in to leave comments.
Login now