##// END OF EJS Templates
Fix a bug in renaming notebook...
Fix a bug in renaming notebook There was a bug in NotebookManager.save_notebook_object. Here is how to reproduce: 0. Make sure you don't have Untitled0. 1. Open new notebook Untitled0. 2. Rename it to something else. 3. Copy Untitled0.ipynb to the notebook dir from somewhere. (Do not use notebook UI.) 4. New copied Untitled0 cannot be opened. The renamed notebook is opened when tried. Indeed, accessing to http://localhost:XXXX/notebooks shows duplicated notebook_id. The problem was that NotebookManager.rev_mapping keeps old notebook name after renaming.

File last commit:

r7253:4b8de020
r7359:ef719b62
Show More
nose_assert_methods.py
17 lines | 516 B | text/x-python | PythonLexer
"""Add some assert methods to nose.tools. These were added in Python 2.7/3.1, so
once we stop testing on Python 2.6, this file can be removed.
"""
import nose.tools as nt
def assert_in(item, collection):
assert item in collection, '%r not in %r' % (item, collection)
if not hasattr(nt, 'assert_in'):
nt.assert_in = assert_in
def assert_not_in(item, collection):
assert item not in collection, '%r in %r' % (item, collection)
if not hasattr(nt, 'assert_not_in'):
nt.assert_not_in = assert_not_in