Show More
@@ -198,6 +198,9 b' class DisplayData(MimeBundle):' | |||||
198 | class ExecuteResult(MimeBundle): |
|
198 | class ExecuteResult(MimeBundle): | |
199 | execution_count = Integer() |
|
199 | execution_count = Integer() | |
200 |
|
200 | |||
|
201 | class HistoryReply(Reference): | |||
|
202 | history = List(List()) | |||
|
203 | ||||
201 |
|
204 | |||
202 | references = { |
|
205 | references = { | |
203 | 'execute_reply' : ExecuteReply(), |
|
206 | 'execute_reply' : ExecuteReply(), | |
@@ -208,6 +211,7 b' references = {' | |||||
208 | 'is_complete_reply': IsCompleteReply(), |
|
211 | 'is_complete_reply': IsCompleteReply(), | |
209 | 'execute_input' : ExecuteInput(), |
|
212 | 'execute_input' : ExecuteInput(), | |
210 | 'execute_result' : ExecuteResult(), |
|
213 | 'execute_result' : ExecuteResult(), | |
|
214 | 'history_reply' : HistoryReply(), | |||
211 | 'error' : Error(), |
|
215 | 'error' : Error(), | |
212 | 'stream' : Stream(), |
|
216 | 'stream' : Stream(), | |
213 | 'display_data' : DisplayData(), |
|
217 | 'display_data' : DisplayData(), | |
@@ -401,11 +405,47 b' def test_single_payload():' | |||||
401 |
|
405 | |||
402 | def test_is_complete(): |
|
406 | def test_is_complete(): | |
403 | flush_channels() |
|
407 | flush_channels() | |
404 |
|
408 | |||
405 | msg_id = KC.is_complete("a = 1") |
|
409 | msg_id = KC.is_complete("a = 1") | |
406 | reply = KC.get_shell_msg(timeout=TIMEOUT) |
|
410 | reply = KC.get_shell_msg(timeout=TIMEOUT) | |
407 | validate_message(reply, 'is_complete_reply', msg_id) |
|
411 | validate_message(reply, 'is_complete_reply', msg_id) | |
408 |
|
412 | |||
|
413 | def test_history_range(): | |||
|
414 | flush_channels() | |||
|
415 | ||||
|
416 | msg_id_exec = KC.execute(code='x=1', store_history = True) | |||
|
417 | reply_exec = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
418 | ||||
|
419 | msg_id = KC.history(hist_access_type = 'range', raw = True, output = True, start = 1, stop = 2, session = 0) | |||
|
420 | reply = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
421 | validate_message(reply, 'history_reply', msg_id) | |||
|
422 | content = reply['content'] | |||
|
423 | nt.assert_equal(len(content['history']), 1) | |||
|
424 | ||||
|
425 | def test_history_tail(): | |||
|
426 | flush_channels() | |||
|
427 | ||||
|
428 | msg_id_exec = KC.execute(code='x=1', store_history = True) | |||
|
429 | reply_exec = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
430 | ||||
|
431 | msg_id = KC.history(hist_access_type = 'tail', raw = True, output = True, n = 1, session = 0) | |||
|
432 | reply = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
433 | validate_message(reply, 'history_reply', msg_id) | |||
|
434 | content = reply['content'] | |||
|
435 | nt.assert_equal(len(content['history']), 1) | |||
|
436 | ||||
|
437 | def test_history_search(): | |||
|
438 | flush_channels() | |||
|
439 | ||||
|
440 | msg_id_exec = KC.execute(code='x=1', store_history = True) | |||
|
441 | reply_exec = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
442 | ||||
|
443 | msg_id = KC.history(hist_access_type = 'search', raw = True, output = True, n = 1, pattern = '*', session = 0) | |||
|
444 | reply = KC.get_shell_msg(timeout=TIMEOUT) | |||
|
445 | validate_message(reply, 'history_reply', msg_id) | |||
|
446 | content = reply['content'] | |||
|
447 | nt.assert_equal(len(content['history']), 1) | |||
|
448 | ||||
409 | # IOPub channel |
|
449 | # IOPub channel | |
410 |
|
450 | |||
411 |
|
451 |
General Comments 0
You need to be logged in to leave comments.
Login now