Skip to content

Commit 2d582e0

Browse files
authored
Merge pull request #2851 from minrk/fix-image-tests
avoid base64-literals in image tests
2 parents 9dabaa2 + ed139a1 commit 2d582e0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

notebook/tests/notebook/roundtrip.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ casper.notebook_test(function () {
150150
check_output_area.apply(this, ['execute_result', ['text', 'html']]);
151151
});
152152

153+
this.then(function() {
154+
clear_and_execute(this,
155+
"from base64 import b64decode;" +
156+
"black_dot_png = b64decode(" + black_dot_png + ");" +
157+
"black_dot_jpeg = b64decode(" + black_dot_jpeg + ")"
158+
);
159+
});
153160
this.then(function() {
154161
clear_and_execute(this,
155162
"from IPython.display import HTML, display; display(HTML('<b>it works!</b>'))");
@@ -162,7 +169,7 @@ casper.notebook_test(function () {
162169

163170
this.then(function() {
164171
clear_and_execute(this,
165-
"from IPython.display import Image; Image(" + black_dot_png + ")");
172+
"from IPython.display import Image; Image(black_dot_png)");
166173
});
167174
this.thenEvaluate(function() { IPython.notebook.save_notebook(); });
168175

@@ -172,7 +179,7 @@ casper.notebook_test(function () {
172179

173180
this.then(function() {
174181
clear_and_execute(this,
175-
"from IPython.display import Image, display; display(Image(" + black_dot_png + "))");
182+
"from IPython.display import Image, display; display(Image(black_dot_png))");
176183
});
177184

178185
this.then(function ( ) {
@@ -182,7 +189,7 @@ casper.notebook_test(function () {
182189

183190
this.then(function() {
184191
clear_and_execute(this,
185-
"from IPython.display import Image; Image(" + black_dot_jpeg + ", format='jpeg')");
192+
"from IPython.display import Image; Image(black_dot_jpeg, format='jpeg')");
186193
});
187194

188195
this.then(function ( ) {
@@ -191,7 +198,7 @@ casper.notebook_test(function () {
191198

192199
this.then(function() {
193200
clear_and_execute(this,
194-
"from IPython.display import Image, display; display(Image(" + black_dot_jpeg + ", format='jpeg'))");
201+
"from IPython.display import Image, display; display(Image(black_dot_jpeg, format='jpeg'))");
195202
});
196203

197204
this.then(function ( ) {

0 commit comments

Comments
 (0)