shutdown_notebook.js
31 lines
| 1018 B
| application/javascript
|
JavascriptLexer
Paul Ivanov
|
r13303 | // | ||
// Test shutdown of a kernel. | ||||
// | ||||
casper.notebook_test(function () { | ||||
Paul Ivanov
|
r13306 | // XXX: test.begin allows named sections but requires casperjs 1.1.0-DEV. | ||
// We will put it back into place when the next version of casper is | ||||
// released. Following that, all instances of this.test can be changed | ||||
// to just test. | ||||
//this.test.begin("shutdown tests (notebook)", 2, function(test) { | ||||
Paul Ivanov
|
r13304 | |||
Paul Ivanov
|
r13306 | this.thenEvaluate(function () { | ||
Paul Ivanov
|
r13303 | $('#kill_and_exit').click(); | ||
}); | ||||
Paul Ivanov
|
r13304 | |||
Paul Ivanov
|
r13306 | this.thenEvaluate(function () { | ||
Paul Ivanov
|
r13303 | var cell = IPython.notebook.get_cell(0); | ||
cell.set_text('a=10; print(a)'); | ||||
cell.execute(); | ||||
}); | ||||
// refactor this into just a get_output(0) | ||||
Paul Ivanov
|
r13306 | this.then(function () { | ||
Paul Ivanov
|
r13303 | var result = this.get_output_cell(0); | ||
Paul Ivanov
|
r13306 | this.test.assertFalsy(result, "after shutdown: no execution results"); | ||
this.test.assertNot(this.kernel_running(), | ||||
Paul Ivanov
|
r13304 | 'after shutdown: IPython.notebook.kernel.running is false '); | ||
Paul Ivanov
|
r13303 | }); | ||
Paul Ivanov
|
r13306 | //}); // end of test.begin | ||
Paul Ivanov
|
r13304 | }); | ||