From d18e40bd6dabe4610a161ce831052b82c72e482d 2013-10-23 18:05:59 From: Paul Ivanov Date: 2013-10-23 18:05:59 Subject: [PATCH] add test for shutdown notebook --- diff --git a/IPython/html/tests/casperjs/test_cases/shutdown_notebook.js b/IPython/html/tests/casperjs/test_cases/shutdown_notebook.js new file mode 100644 index 0000000..db51421 --- /dev/null +++ b/IPython/html/tests/casperjs/test_cases/shutdown_notebook.js @@ -0,0 +1,25 @@ +// +// Test shutdown of a kernel. +// +casper.notebook_test(function () { + this.test.begin("shutdown tests", 2, function(test) { + casper.evaluate(function () { + $('#kill_and_exit').click(); + }); + + casper.thenEvaluate(function () { + var cell = IPython.notebook.get_cell(0); + cell.set_text('a=10; print(a)'); + cell.execute(); + }); + + // refactor this into just a get_output(0) + casper.then(function () { + var result = this.get_output_cell(0); + test.assertFalsy(result, "after shutdown: no execution results"); + test.assertNot(this.kernel_running(), + 'after shutdown: IPython.notebook.kernel is false '); + }); +}); + +});