##// END OF EJS Templates
don't store signatures in notebooks...
don't store signatures in notebooks store them in an sqlite database instead. The algorithm and signature are stored and not associated with a path. This means that moving files around doesn't affect trust, and every trusted change to a notebook remains trusted.

File last commit:

r19545:3a7bc354
r19625:0dbcfac8
Show More
dualmode_cellinsert.js
77 lines | 3.3 KiB | application/javascript | JavascriptLexer
/ IPython / html / tests / notebook / dualmode_cellinsert.js
Jonathan Frederic
Cleaned up test names and locations.
r15936
// Test
casper.notebook_test(function () {
var a = 'print("a")';
var index = this.append_cell(a);
this.execute_cell_then(index);
var b = 'print("b")';
index = this.append_cell(b);
this.execute_cell_then(index);
var c = 'print("c")';
index = this.append_cell(c);
this.execute_cell_then(index);
MinRK
make default cell type configurable...
r17785
this.thenEvaluate(function() {
IPython.notebook.default_cell_type = 'code';
});
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.then(function () {
// Cell insertion
this.select_cell(2);
MinRK
make default cell type configurable...
r17785 this.trigger_keydown('m'); // Make it markdown
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.trigger_keydown('a'); // Creates one cell
this.test.assertEquals(this.get_cell_text(2), '', 'a; New cell 2 text is empty');
MinRK
make default cell type configurable...
r17785 this.test.assertEquals(this.get_cell(2).cell_type, 'code', 'a; inserts a code cell');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.validate_notebook_state('a', 'command', 2);
this.trigger_keydown('b'); // Creates one cell
this.test.assertEquals(this.get_cell_text(2), '', 'b; Cell 2 text is still empty');
this.test.assertEquals(this.get_cell_text(3), '', 'b; New cell 3 text is empty');
MinRK
make default cell type configurable...
r17785 this.test.assertEquals(this.get_cell(3).cell_type, 'code', 'b; inserts a code cell');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.validate_notebook_state('b', 'command', 3);
});
MinRK
make default cell type configurable...
r17785
this.thenEvaluate(function() {
Thomas Kluyver
Update test to modify class config for default_cell_type
r19545 IPython.notebook.class_config.set('default_cell_type', 'selected');
MinRK
make default cell type configurable...
r17785 });
Paul Ivanov
add tests for cell_type preserving insertion
r16781 this.then(function () {
this.select_cell(2);
this.trigger_keydown('m'); // switch it to markdown for the next test
MinRK
make default cell type configurable...
r17785 this.test.assertEquals(this.get_cell(2).cell_type, 'markdown', 'test cell is markdown');
this.trigger_keydown('a'); // new cell above
this.test.assertEquals(this.get_cell(2).cell_type, 'markdown', 'a; inserts a markdown cell when markdown selected');
this.trigger_keydown('b'); // new cell below
this.test.assertEquals(this.get_cell(3).cell_type, 'markdown', 'b; inserts a markdown cell when markdown selected');
});
this.thenEvaluate(function() {
Thomas Kluyver
Update test to modify class config for default_cell_type
r19545 IPython.notebook.class_config.set('default_cell_type', 'above');
MinRK
make default cell type configurable...
r17785 });
this.then(function () {
this.select_cell(2);
MinRK
remove heading cells in v4
r18596 this.trigger_keydown('y'); // switch it to code for the next test
this.test.assertEquals(this.get_cell(2).cell_type, 'code', 'test cell is code');
MinRK
make default cell type configurable...
r17785 this.trigger_keydown('b'); // new cell below
MinRK
remove heading cells in v4
r18596 this.test.assertEquals(this.get_cell(3).cell_type, 'code', 'b; inserts a code cell below code cell');
MinRK
make default cell type configurable...
r17785 this.trigger_keydown('a'); // new cell above
MinRK
address review from takluyver...
r18602 this.test.assertEquals(this.get_cell(3).cell_type, 'code', 'a; inserts a code cell above code cell');
MinRK
make default cell type configurable...
r17785 });
this.thenEvaluate(function() {
Thomas Kluyver
Update test to modify class config for default_cell_type
r19545 IPython.notebook.class_config.set('default_cell_type', 'below');
MinRK
make default cell type configurable...
r17785 });
this.then(function () {
this.select_cell(2);
this.trigger_keydown('r'); // switch it to markdown for the next test
this.test.assertEquals(this.get_cell(2).cell_type, 'raw', 'test cell is raw');
this.trigger_keydown('a'); // new cell above
this.test.assertEquals(this.get_cell(2).cell_type, 'raw', 'a; inserts a raw cell above raw cell');
this.trigger_keydown('y'); // switch it to code for the next test
this.trigger_keydown('b'); // new cell below
MinRK
address review from takluyver...
r18602 this.test.assertEquals(this.get_cell(3).cell_type, 'raw', 'b; inserts a raw cell below raw cell');
Paul Ivanov
add tests for cell_type preserving insertion
r16781 });
});