##// END OF EJS Templates
minor shortening
Paul Ivanov -
Show More
@@ -1,47 +1,45 b''
1 1 //
2 2 // Test kernel interrupt
3 3 //
4 4 casper.notebook_test(function () {
5 5 this.evaluate(function () {
6 6 var cell = IPython.notebook.get_cell(0);
7 7 cell.set_text('import time\nfor x in range(3):\n time.sleep(1)');
8 8 cell.execute();
9 9 });
10 10
11 11
12 12 // interrupt using menu item (Kernel -> Interrupt)
13 13 this.thenClick('li#int_kernel');
14 14
15 15 this.wait_for_output(0);
16 16
17 17 this.then(function () {
18 18 var result = this.evaluate(function () {
19 19 var cell = IPython.notebook.get_cell(0);
20 var output = cell.output_area.outputs[0].ename;
21 return output;
20 return cell.output_area.outputs[0].ename;
22 21 })
23 22 this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt (mouseclick)');
24 23 });
25 24
26 25 // run cell 0 again, now interrupting using keyboard shortcut
27 26 this.thenEvaluate(function () {
28 27 cell.clear_output();
29 28 cell.execute();
30 29 });
31 30
32 31 // interrupt using Ctrl-M I keyboard shortcut
33 32 this.thenEvaluate( function() {
34 33 IPython.utils.press_ghetto(IPython.utils.keycodes.I)
35 34 });
36 35
37 36 this.wait_for_output(0);
38 37
39 38 this.then(function () {
40 39 var result = this.evaluate(function () {
41 40 var cell = IPython.notebook.get_cell(0);
42 var output = cell.output_area.outputs[0].ename;
43 return output;
41 return cell.output_area.outputs[0].ename;
44 42 });
45 43 this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt (shortcut)');
46 44 });
47 45 });
General Comments 0
You need to be logged in to leave comments. Login now