Show More
@@ -27,6 +27,7 b' from IPython.core.application import BaseIPythonApplication' | |||
|
27 | 27 | from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory |
|
28 | 28 | from IPython.utils.py3compat import str_to_bytes |
|
29 | 29 | from IPython.kernel import connect |
|
30 | from IPython.kernel.zmq.session import Session | |
|
30 | 31 | |
|
31 | 32 | #----------------------------------------------------------------------------- |
|
32 | 33 | # Classes and functions |
@@ -52,6 +53,24 b' def test_write_connection_file():' | |||
|
52 | 53 | info['key'] = str_to_bytes(info['key']) |
|
53 | 54 | nt.assert_equal(info, sample_info) |
|
54 | 55 | |
|
56 | ||
|
57 | def test_load_connection_file_session(): | |
|
58 | """test load_connection_file() after """ | |
|
59 | session = Session() | |
|
60 | app = DummyConsoleApp(session=Session()) | |
|
61 | app.initialize(argv=[]) | |
|
62 | session = app.session | |
|
63 | ||
|
64 | with TemporaryDirectory() as d: | |
|
65 | cf = os.path.join(d, 'kernel.json') | |
|
66 | connect.write_connection_file(cf, **sample_info) | |
|
67 | app.connection_file = cf | |
|
68 | app.load_connection_file() | |
|
69 | ||
|
70 | nt.assert_equal(session.key, sample_info['key']) | |
|
71 | nt.assert_equal(session.signature_scheme, sample_info['signature_scheme']) | |
|
72 | ||
|
73 | ||
|
55 | 74 | def test_app_load_connection_file(): |
|
56 | 75 | """test `ipython console --existing` loads a connection file""" |
|
57 | 76 | with TemporaryDirectory() as d: |
General Comments 0
You need to be logged in to leave comments.
Login now