Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
followed suggestion by tom, started tests
- Loading branch information
1 parent
d468081
commit 4d45ec7
Showing
3 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// Test prompt when overwriting a file that is modified on disk | ||
// | ||
|
||
casper.editor_test(function () { | ||
var fname = "has#hash and space and unicø∂e.py"; | ||
|
||
this.append_cell("s = '??'", 'code'); | ||
|
||
this.thenEvaluate(function (nbname) { | ||
require(['base/js/events'], function (events) { | ||
IPython.editor.set_notebook_name(nbname); | ||
IPython._save_success = IPython._save_failed = false; | ||
events.on('file_saved.Editor', function () { | ||
IPython._save_success = true; | ||
}); | ||
IPython.notebook.save_notebook(); | ||
}); | ||
}, {nbname:nbname}); | ||
|
||
this.waitFor(function () { | ||
return this.evaluate(function(){ | ||
return IPython._save_failed || IPython._save_success; | ||
}); | ||
}); | ||
|
||
this.thenEvaluate(function(){ | ||
IPython._checkpoint_created = false; | ||
require(['base/js/events'], function (events) { | ||
events.on('checkpoint_created.Notebook', function (evt, data) { | ||
IPython._checkpoint_created = true; | ||
}); | ||
}); | ||
IPython.notebook.save_checkpoint(); | ||
}); | ||
|
||
this.waitFor(function() { | ||
return this.evaluate(function () { | ||
return IPython && IPython.notebook && true; | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters