##// END OF EJS Templates
define and test IPython.kernel public API
MinRK -
Show More
@@ -0,0 +1,41 b''
1 """Test the IPython.kernel public API
2
3 Authors
4 -------
5 * MinRK
6 """
7 #-----------------------------------------------------------------------------
8 # Copyright (c) 2013, the IPython Development Team.
9 #
10 # Distributed under the terms of the Modified BSD License.
11 #
12 # The full license is in the file COPYING.txt, distributed with this software.
13 #-----------------------------------------------------------------------------
14
15 import nose.tools as nt
16
17 from IPython.testing import decorators as dec
18
19 from IPython.kernel import launcher, connect
20 from IPython import kernel
21
22 #-----------------------------------------------------------------------------
23 # Classes and functions
24 #-----------------------------------------------------------------------------
25
26 @dec.parametric
27 def test_kms():
28 for base in ("", "Blocking", "Multi"):
29 KM = base + "KernelManager"
30 yield nt.assert_true(KM in dir(kernel), KM)
31
32 @dec.parametric
33 def test_launcher():
34 for name in launcher.__all__:
35 yield nt.assert_true(name in dir(kernel), name)
36
37 @dec.parametric
38 def test_connect():
39 for name in connect.__all__:
40 yield nt.assert_true(name in dir(kernel), name)
41
@@ -61,6 +61,7 b' from IPython.config.application import catch_config_error, boolean_flag'
61 from IPython.core.application import BaseIPythonApplication
61 from IPython.core.application import BaseIPythonApplication
62 from IPython.core.profiledir import ProfileDir
62 from IPython.core.profiledir import ProfileDir
63 from IPython.frontend.consoleapp import IPythonConsoleApp
63 from IPython.frontend.consoleapp import IPythonConsoleApp
64 from IPython.kernel import swallow_argv
64 from IPython.kernel.zmq.session import Session, default_secure
65 from IPython.kernel.zmq.session import Session, default_secure
65 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
66 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
66 from IPython.kernel.zmq.kernelapp import (
67 from IPython.kernel.zmq.kernelapp import (
@@ -70,7 +71,6 b' from IPython.kernel.zmq.kernelapp import ('
70 )
71 )
71 from IPython.utils.importstring import import_item
72 from IPython.utils.importstring import import_item
72 from IPython.utils.localinterfaces import LOCALHOST
73 from IPython.utils.localinterfaces import LOCALHOST
73 from IPython.kernel import swallow_argv
74 from IPython.utils.traitlets import (
74 from IPython.utils.traitlets import (
75 Dict, Unicode, Integer, List, Enum, Bool,
75 Dict, Unicode, Integer, List, Enum, Bool,
76 DottedObjectName
76 DottedObjectName
@@ -1,5 +1,7 b''
1 """IPython kernel bases and utilities"""
1 """IPython kernels and associated utilities"""
2
2
3 from .connect import *
3 from .connect import *
4 from .launcher import *
4 from .launcher import *
5 from .kernelmanagerabc import *
5 from .kernelmanager import KernelManager
6 from .blockingkernelmanager import BlockingKernelManager
7 from .multikernelmanager import MultiKernelManager
@@ -337,3 +337,11 b' def tunnel_to_kernel(connection_info, sshserver, sshkey=None):'
337
337
338 return tuple(lports)
338 return tuple(lports)
339
339
340 __all__ = [
341 'write_connection_file',
342 'get_connection_file',
343 'find_connection_file',
344 'get_connection_info',
345 'connect_qtconsole',
346 'tunnel_to_kernel',
347 ] No newline at end of file
@@ -14,7 +14,7 b''
14 # Local imports.
14 # Local imports.
15 from IPython.config.configurable import Configurable
15 from IPython.config.configurable import Configurable
16 from IPython.utils.traitlets import Any, Instance, Type
16 from IPython.utils.traitlets import Any, Instance, Type
17 from IPython.kernel import (
17 from IPython.kernel.kernelmanagerabc import (
18 ShellChannelABC, IOPubChannelABC,
18 ShellChannelABC, IOPubChannelABC,
19 HBChannelABC, StdInChannelABC,
19 HBChannelABC, StdInChannelABC,
20 KernelManagerABC
20 KernelManagerABC
@@ -47,8 +47,8 b' from IPython.kernel import ('
47 make_ipkernel_cmd,
47 make_ipkernel_cmd,
48 launch_kernel,
48 launch_kernel,
49 )
49 )
50 from IPython.kernel.zmq.session import Session
50 from .zmq.session import Session
51 from IPython.kernel import (
51 from .kernelmanagerabc import (
52 ShellChannelABC, IOPubChannelABC,
52 ShellChannelABC, IOPubChannelABC,
53 HBChannelABC, StdInChannelABC,
53 HBChannelABC, StdInChannelABC,
54 KernelManagerABC
54 KernelManagerABC
@@ -251,3 +251,8 b' def launch_kernel(cmd, stdin=None, stdout=None, stderr=None,'
251
251
252 return proc
252 return proc
253
253
254 __all__ = [
255 'swallow_argv',
256 'make_ipkernel_cmd',
257 'launch_kernel',
258 ] No newline at end of file
@@ -42,7 +42,7 b' class TestKernelManager(TestCase):'
42 self._run_lifecycle(km)
42 self._run_lifecycle(km)
43
43
44 @dec.skip_win32
44 @dec.skip_win32
45 def testipc_lifecycle(self):
45 def test_ipc_lifecycle(self):
46 km = self._get_ipc_km()
46 km = self._get_ipc_km()
47 self._run_lifecycle(km)
47 self._run_lifecycle(km)
48
48
General Comments 0
You need to be logged in to leave comments. Login now