##// END OF EJS Templates
minimal notebook rountrip test
Paul Ivanov -
Show More
@@ -0,0 +1,48 b''
1 // Test opening a rich notebook, saving it, and reopening it again.
2 //
3 //toJSON fromJSON toJSON and do a string comparison
4 casper.notebook_test(function () {
5 this.evaluate(function () {
6 var cell = IPython.notebook.get_cell(0);
7 // "we have to make messes to find out who we are"
8 cell.set_text([
9 "%%javascript",
10 "IPython.notebook.insert_cell_above('code')"
11 ].join('\n')
12 );
13
14 cell.execute();
15 });
16
17 this.wait_for_output(0);
18
19 this.then(function ( ) {
20 var result = this.get_output_cell(1);
21 var num_cells = this.get_cells_length();
22 this.test.assertEquals(num_cells, 2, '%%javascript magic works');
23 this.test.assertTrue(result.hasOwnProperty('application/javascript'), 'JS embeded with mime key');
24 });
25
26
27 //this.thenEvaluate(function () { var cell = IPython.notebook.get_cell(0);
28
29 // // we have to make messes to find out who we are
30 // cell.set_text([
31 // "import IPython.html.tests as t",
32 // "t.write_test_notebook('rich_output.ipynb')"
33 // ].join('\n')
34 // );
35
36 // cell.execute();
37 //});
38 //
39 //this.wait_for_output(0);
40
41 //this.then(function ( ) {
42 // var result = this.get_output_cell(0);
43 // var num_cells = this.get_cells_length();
44 // this.test.assertEquals(result.text, '10\n', 'opening notebook JSON');
45 // this.test.assertEquals(num_cells, 2, ' %%javascript magic works')
46 //});
47
48 });
General Comments 0
You need to be logged in to leave comments. Login now