This file is indexed.

/usr/share/pyshared/IPython/frontend/html/notebook/tests/test_kernelsession.py is in ipython-notebook 0.12.1+dfsg-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""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)