##// END OF EJS Templates
Pythonize me captin'...
Pythonize me captin' Made the method comments more pythonic by moving them within the method definitions.

File last commit:

r15941:3ba9c75a
r15942:9fe4cd5e
Show More
merge_cells_api.js
42 lines | 1.4 KiB | application/javascript | JavascriptLexer
//
// Test merging two notebook cells.
//
casper.notebook_test(function() {
var that = this;
var output = this.evaluate(function () {
// Fill in test data.
IPython.notebook.command_mode();
var set_cell_text = function () {
var cell_one = IPython.notebook.get_selected_cell();
cell_one.set_text('a = 5');
var element = $(document);
var event = IPython.keyboard.shortcut_to_event('b', 'keydown');
element.trigger(event);
var cell_two = IPython.notebook.get_selected_cell();
cell_two.set_text('print(a)');
};
// merge_cell_above()
set_cell_text();
IPython.notebook.merge_cell_above();
var merged_above = IPython.notebook.get_selected_cell();
// merge_cell_below()
set_cell_text();
IPython.notebook.select(0);
IPython.notebook.merge_cell_below();
var merged_below = IPython.notebook.get_selected_cell();
return {
above: merged_above.get_text(),
below: merged_below.get_text()
};
});
this.test.assertEquals(output.above, 'a = 5\nprint(a)',
'Successful merge_cell_above().');
this.test.assertEquals(output.below, 'a = 5\nprint(a)',
'Successful merge_cell_below().');
});