##// END OF EJS Templates
fix safe_append_output test
MinRK -
Show More
@@ -1,32 +1,32
1 1 //
2 2 // Test validation in append_output
3 3 //
4 4 // Invalid output data is stripped and logged.
5 5 //
6 6
7 7 casper.notebook_test(function () {
8 8 // this.printLog();
9 9 var messages = [];
10 10 this.on('remote.message', function (msg) {
11 11 messages.push(msg);
12 12 });
13 13
14 14 this.evaluate(function () {
15 15 var cell = IPython.notebook.get_cell(0);
16 16 cell.set_text( "dp = get_ipython().display_pub\n" +
17 "dp.publish('test', {'text/plain' : '5', 'image/png' : 5})"
17 "dp.publish({'text/plain' : '5', 'image/png' : 5})"
18 18 );
19 19 cell.execute();
20 20 });
21 21
22 22 this.wait_for_output(0);
23 23 this.on('remote.message', function () {});
24 24
25 25 this.then(function () {
26 26 var output = this.get_output_cell(0);
27 27 this.test.assert(messages.length > 0, "Captured log message");
28 28 this.test.assertEquals(messages[messages.length-1], "Invalid type for image/png 5", "Logged Invalid type message");
29 29 this.test.assertEquals(output['image/png'], undefined, "Non-string png data was stripped");
30 30 this.test.assertEquals(output['text/plain'], '5', "text data is fine");
31 31 });
32 32 });
General Comments 0
You need to be logged in to leave comments. Login now