From 8233daa76e0e8774ace92a4bbea836ad4cf5c936 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Tue, 6 Nov 2018 08:02:23 +0000 Subject: [PATCH] msg_type is part of the message header, not top-level --- notebook/tests/notebook/display_id.js | 4 ++-- notebook/tests/notebook/output.js | 8 ++++---- notebook/tests/services/kernel.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/notebook/tests/notebook/display_id.js b/notebook/tests/notebook/display_id.js index f60a87d704..e6e6b60e4b 100644 --- a/notebook/tests/notebook/display_id.js +++ b/notebook/tests/notebook/display_id.js @@ -99,10 +99,10 @@ casper.notebook_test(function () { cell.execute(); var kernel = IPython.notebook.kernel; var msg_id = cell.last_msg_id; - var callback_id = 'mycallbackid' + var callback_id = 'mycallbackid'; cell.iopub_messages = []; var add_msg = function(msg) { - msg.content.output_type = msg.msg_type; + msg.content.output_type = msg.header.msg_type; cell.iopub_messages.push(msg.content); }; kernel.set_callbacks_for_msg(callback_id, { diff --git a/notebook/tests/notebook/output.js b/notebook/tests/notebook/output.js index cfc6958388..6e33139478 100644 --- a/notebook/tests/notebook/output.js +++ b/notebook/tests/notebook/output.js @@ -151,13 +151,13 @@ casper.notebook_test(function () { cell.execute(); var kernel = IPython.notebook.kernel; var msg_id = cell.last_msg_id; - var callback_id = 'mycallbackid' + var callback_id = 'mycallbackid'; cell.iopub_messages = []; var add_msg = function(msg) { if (msg.content.text==="remove handler\n") { kernel.output_callback_overrides_pop(msg_id); } - msg.content.output_type = msg.msg_type; + msg.content.output_type = msg.header.msg_type; cell.iopub_messages.push(msg.content); }; kernel.set_callbacks_for_msg(callback_id, { @@ -221,10 +221,10 @@ casper.notebook_test(function () { cell.execute(); var kernel = IPython.notebook.kernel; var msg_id = cell.last_msg_id; - var callback_id = 'mycallbackid2' + var callback_id = 'mycallbackid2'; cell.iopub_messages = []; var add_msg = function(msg) { - msg.content.output_type = msg.msg_type; + msg.content.output_type = msg.header.msg_type; cell.iopub_messages.push(msg.content); }; kernel.set_callbacks_for_msg(callback_id, { diff --git a/notebook/tests/services/kernel.js b/notebook/tests/services/kernel.js index df69fdf02c..b5ccf857e1 100644 --- a/notebook/tests/services/kernel.js +++ b/notebook/tests/services/kernel.js @@ -112,8 +112,8 @@ casper.notebook_test(function () { var kernel_info_response = this.evaluate(function(){ return IPython._kernel_info_response; }); - this.test.assertTrue( kernel_info_response.msg_type === 'kernel_info_reply', 'Kernel info request return kernel_info_reply'); - this.test.assertTrue( kernel_info_response.content !== undefined, 'Kernel_info_reply is not undefined'); + this.test.assertEquals( kernel_info_response.header.msg_type, 'kernel_info_reply', 'Kernel info request return kernel_info_reply'); + this.test.assertNotEquals( kernel_info_response.content, undefined, 'Kernel_info_reply is not undefined'); }); // test kill