##// END OF EJS Templates
Support echoing output from other clients...
Support echoing output from other clients in the zmq console Can result in outputs like: ``` In [1]: 1 [remote]In [1]: 1 [remote]Out[1]: 1 [remote]In [2]: 3 [remote]Out[2]: 3 Out[3]: 1 ``` Note that there will be inconsistencies in prompt numbers because some execution may take place after the in-prompt is drawn.

File last commit:

r18341:9e6b62e8
r18373:fbda5499
Show More
prompt_numbers.js
36 lines | 1.3 KiB | application/javascript | JavascriptLexer
Jessica B. Hamrick
Add regression tests for live notebook
r18341
// Test
casper.notebook_test(function () {
var that = this;
var set_prompt = function (i, val) {
that.evaluate(function (i, val) {
var cell = IPython.notebook.get_cell(i);
cell.set_input_prompt(val);
}, [i, val]);
};
var get_prompt = function (i) {
return that.evaluate(function (i) {
var elem = IPython.notebook.get_cell(i).element;
return elem.find('div.input_prompt').html();
}, [i]);
};
this.then(function () {
var a = 'print("a")';
var index = this.append_cell(a);
this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is   by default");
set_prompt(index, 2);
this.test.assertEquals(get_prompt(index), "In [2]:", "prompt number is 2");
set_prompt(index, 0);
this.test.assertEquals(get_prompt(index), "In [0]:", "prompt number is 0");
set_prompt(index, "*");
this.test.assertEquals(get_prompt(index), "In [*]:", "prompt number is *");
set_prompt(index, undefined);
this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  ");
set_prompt(index, null);
this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  ");
});
});