Show More
@@ -363,6 +363,12 b' class ShellSocketChannel(ZMQSocketChannel):' | |||||
363 | self._queue_send(msg) |
|
363 | self._queue_send(msg) | |
364 | return msg['header']['msg_id'] |
|
364 | return msg['header']['msg_id'] | |
365 |
|
365 | |||
|
366 | def version(self): | |||
|
367 | """Request kernel version info.""" | |||
|
368 | msg = self.session.msg('version_request') | |||
|
369 | self._queue_send(msg) | |||
|
370 | return msg['header']['msg_id'] | |||
|
371 | ||||
366 | def shutdown(self, restart=False): |
|
372 | def shutdown(self, restart=False): | |
367 | """Request an immediate kernel shutdown. |
|
373 | """Request an immediate kernel shutdown. | |
368 |
|
374 |
@@ -16,6 +16,7 b' from Queue import Empty' | |||||
16 | import nose.tools as nt |
|
16 | import nose.tools as nt | |
17 |
|
17 | |||
18 | from ..blockingkernelmanager import BlockingKernelManager |
|
18 | from ..blockingkernelmanager import BlockingKernelManager | |
|
19 | from .. import ipkernel | |||
19 |
|
20 | |||
20 |
|
21 | |||
21 | from IPython.testing import decorators as dec |
|
22 | from IPython.testing import decorators as dec | |
@@ -195,6 +196,12 b' class CompleteReply(Reference):' | |||||
195 | matches = List(Unicode) |
|
196 | matches = List(Unicode) | |
196 |
|
197 | |||
197 |
|
198 | |||
|
199 | class VersionReply(Reference): | |||
|
200 | version = Enum((ipkernel.version)) | |||
|
201 | version_major = Enum((ipkernel.version_major,)) | |||
|
202 | version_minor = Enum((ipkernel.version_minor,)) | |||
|
203 | ||||
|
204 | ||||
198 | # IOPub messages |
|
205 | # IOPub messages | |
199 |
|
206 | |||
200 | class PyIn(Reference): |
|
207 | class PyIn(Reference): | |
@@ -236,6 +243,7 b' references = {' | |||||
236 | 'object_info_reply' : OInfoReply(), |
|
243 | 'object_info_reply' : OInfoReply(), | |
237 | 'status' : Status(), |
|
244 | 'status' : Status(), | |
238 | 'complete_reply' : CompleteReply(), |
|
245 | 'complete_reply' : CompleteReply(), | |
|
246 | 'version_reply': VersionReply(), | |||
239 | 'pyin' : PyIn(), |
|
247 | 'pyin' : PyIn(), | |
240 | 'pyout' : PyOut(), |
|
248 | 'pyout' : PyOut(), | |
241 | 'pyerr' : PyErr(), |
|
249 | 'pyerr' : PyErr(), | |
@@ -434,6 +442,18 b' def test_complete():' | |||||
434 | yield nt.assert_true(name in matches, "Missing match: %r" % name) |
|
442 | yield nt.assert_true(name in matches, "Missing match: %r" % name) | |
435 |
|
443 | |||
436 |
|
444 | |||
|
445 | @dec.parametric | |||
|
446 | def test_version_request(): | |||
|
447 | flush_channels() | |||
|
448 | ||||
|
449 | shell = KM.shell_channel | |||
|
450 | ||||
|
451 | msg_id = shell.version() | |||
|
452 | reply = shell.get_msg(timeout=2) | |||
|
453 | for tst in validate_message(reply, 'version_reply', msg_id): | |||
|
454 | yield tst | |||
|
455 | ||||
|
456 | ||||
437 | # IOPub channel |
|
457 | # IOPub channel | |
438 |
|
458 | |||
439 |
|
459 |
General Comments 0
You need to be logged in to leave comments.
Login now