Show More
@@ -27,9 +27,9 b' function assert_has(short_name, json, result, result2) {' | |||
|
27 | 27 | this.test.assertTrue(json[0].hasOwnProperty(short_name), |
|
28 | 28 | 'toJSON() representation uses ' + short_name); |
|
29 | 29 | this.test.assertTrue(result.hasOwnProperty(long_name), |
|
30 | 'toJSON() original embeded JSON keeps ' + long_name); | |
|
30 | 'toJSON() original embedded JSON keeps ' + long_name); | |
|
31 | 31 | this.test.assertTrue(result2.hasOwnProperty(long_name), |
|
32 | 'fromJSON() embeded ' + short_name + ' gets mime key ' + long_name); | |
|
32 | 'fromJSON() embedded ' + short_name + ' gets mime key ' + long_name); | |
|
33 | 33 | } |
|
34 | 34 | |
|
35 | 35 | // helper function for checkout that the first two cells have a particular |
@@ -40,11 +40,11 b' function check_output_area(output_type, keys) {' | |||
|
40 | 40 | this.wait_for_output(0); |
|
41 | 41 | json = this.evaluate(function() { |
|
42 | 42 | var json = IPython.notebook.get_cell(0).output_area.toJSON(); |
|
43 |
// appended cell will initially be empty, lets add |
|
|
44 |
|
|
|
43 | // appended cell will initially be empty, let's add some output | |
|
44 | IPython.notebook.get_cell(1).output_area.fromJSON(json); | |
|
45 | 45 | return json; |
|
46 | 46 | }); |
|
47 |
// The evaluate call above happens async |
|
|
47 | // The evaluate call above happens asynchronously: wait for cell[1] to have output | |
|
48 | 48 | this.wait_for_output(1); |
|
49 | 49 | var result = this.get_output_cell(0); |
|
50 | 50 | var result2 = this.get_output_cell(1); |
@@ -88,12 +88,19 b' casper.notebook_test(function () {' | |||
|
88 | 88 | var num_cells = this.get_cells_length(); |
|
89 | 89 | this.test.assertEquals(num_cells, 2, '%%javascript magic works'); |
|
90 | 90 | this.test.assertTrue(result.hasOwnProperty('application/javascript'), |
|
91 | 'testing JS embeded with mime key'); | |
|
91 | 'testing JS embedded with mime key'); | |
|
92 | 92 | }); |
|
93 | 93 | |
|
94 | 94 | //this.thenEvaluate(function() { IPython.notebook.save_notebook(); }); |
|
95 | this.then(function () { | |
|
96 | clear_and_execute(this, [ | |
|
97 | "%%javascript", | |
|
98 | "var a=5;" | |
|
99 | ].join('\n')); | |
|
100 | }); | |
|
101 | ||
|
95 | 102 | |
|
96 |
this.then(function ( |
|
|
103 | this.then(function () { | |
|
97 | 104 | check_output_area.apply(this, ['display_data', ['javascript']]); |
|
98 | 105 | |
|
99 | 106 | }); |
@@ -223,7 +230,9 b' casper.notebook_test(function () {' | |||
|
223 | 230 | |
|
224 | 231 | }); |
|
225 | 232 | |
|
226 | this.then(function ( ) { | |
|
233 | this.wait_for_output(0, 1); | |
|
234 | ||
|
235 | this.then(function () { | |
|
227 | 236 | var long_name = 'text/superfancymimetype'; |
|
228 | 237 | var result = this.get_output_cell(0); |
|
229 | 238 | this.test.assertTrue(result.hasOwnProperty(long_name), |
General Comments 0
You need to be logged in to leave comments.
Login now