test_manager.py
524 lines
| 18.1 KiB
| text/x-python
|
PythonLexer
|
r13136 | # coding: utf-8 | ||
|
r7637 | """Tests for the notebook manager.""" | ||
|
r13348 | from __future__ import print_function | ||
|
r7637 | |||
import os | ||||
|
r20575 | import sys | ||
|
r19628 | import time | ||
|
r20658 | from contextlib import contextmanager | ||
|
r13046 | |||
|
r20490 | from nose import SkipTest | ||
|
r13046 | from tornado.web import HTTPError | ||
|
r7637 | from unittest import TestCase | ||
from tempfile import NamedTemporaryFile | ||||
|
r18607 | from IPython.nbformat import v4 as nbformat | ||
|
r15655 | |||
|
r7637 | from IPython.utils.tempdir import TemporaryDirectory | ||
from IPython.utils.traitlets import TraitError | ||||
|
r17710 | from IPython.testing import decorators as dec | ||
|
r7637 | |||
|
r17524 | from ..filemanager import FileContentsManager | ||
|
r7637 | |||
|
r15079 | |||
|
r19612 | def _make_dir(contents_manager, api_path): | ||
""" | ||||
Make a directory. | ||||
""" | ||||
os_path = contents_manager._get_os_path(api_path) | ||||
try: | ||||
os.makedirs(os_path) | ||||
except OSError: | ||||
print("Directory already exists: %r" % os_path) | ||||
|
r17524 | class TestFileContentsManager(TestCase): | ||
|
r7637 | |||
|
r20743 | @contextmanager | ||
def assertRaisesHTTPError(self, status, msg=None): | ||||
msg = msg or "Should have raised HTTPError(%i)" % status | ||||
try: | ||||
yield | ||||
except HTTPError as e: | ||||
self.assertEqual(e.status_code, status) | ||||
else: | ||||
self.fail(msg) | ||||
|
r19612 | def symlink(self, contents_manager, src, dst): | ||
|
r19611 | """Make a symlink to src from dst | ||
src and dst are api_paths | ||||
""" | ||||
|
r19612 | src_os_path = contents_manager._get_os_path(src) | ||
dst_os_path = contents_manager._get_os_path(dst) | ||||
|
r19611 | print(src_os_path, dst_os_path, os.path.isfile(src_os_path)) | ||
os.symlink(src_os_path, dst_os_path) | ||||
|
r17524 | def test_root_dir(self): | ||
|
r7637 | with TemporaryDirectory() as td: | ||
|
r17524 | fm = FileContentsManager(root_dir=td) | ||
self.assertEqual(fm.root_dir, td) | ||||
|
r7637 | |||
|
r17524 | def test_missing_root_dir(self): | ||
|
r7637 | with TemporaryDirectory() as td: | ||
|
r17524 | root = os.path.join(td, 'notebook', 'dir', 'is', 'missing') | ||
self.assertRaises(TraitError, FileContentsManager, root_dir=root) | ||||
|
r7637 | |||
|
r17524 | def test_invalid_root_dir(self): | ||
|
r7637 | with NamedTemporaryFile() as tf: | ||
|
r17524 | self.assertRaises(TraitError, FileContentsManager, root_dir=tf.name) | ||
|
r7637 | |||
|
r13032 | def test_get_os_path(self): | ||
# full filesystem path should be returned with correct operating system | ||||
# separators. | ||||
with TemporaryDirectory() as td: | ||||
|
r17524 | root = td | ||
fm = FileContentsManager(root_dir=root) | ||||
|
r18749 | path = fm._get_os_path('/path/to/notebook/test.ipynb') | ||
|
r13034 | rel_path_list = '/path/to/notebook/test.ipynb'.split('/') | ||
|
r17524 | fs_path = os.path.join(fm.root_dir, *rel_path_list) | ||
|
r13034 | self.assertEqual(path, fs_path) | ||
|
r17524 | fm = FileContentsManager(root_dir=root) | ||
|
r15420 | path = fm._get_os_path('test.ipynb') | ||
|
r17524 | fs_path = os.path.join(fm.root_dir, 'test.ipynb') | ||
|
r13034 | self.assertEqual(path, fs_path) | ||
|
r17524 | fm = FileContentsManager(root_dir=root) | ||
|
r18749 | path = fm._get_os_path('////test.ipynb') | ||
|
r17524 | fs_path = os.path.join(fm.root_dir, 'test.ipynb') | ||
|
r13034 | self.assertEqual(path, fs_path) | ||
|
r17523 | |||
|
r16440 | def test_checkpoint_subdir(self): | ||
subd = u'sub ∂ir' | ||||
cp_name = 'test-cp.ipynb' | ||||
with TemporaryDirectory() as td: | ||||
|
r17524 | root = td | ||
|
r16440 | os.mkdir(os.path.join(td, subd)) | ||
|
r17524 | fm = FileContentsManager(root_dir=root) | ||
|
r19839 | cpm = fm.checkpoints | ||
|
r19786 | cp_dir = cpm.checkpoint_path( | ||
|
r19727 | 'cp', 'test.ipynb' | ||
) | ||||
|
r19786 | cp_subdir = cpm.checkpoint_path( | ||
|
r19727 | 'cp', '/%s/test.ipynb' % subd | ||
) | ||||
|
r16440 | self.assertNotEqual(cp_dir, cp_subdir) | ||
|
r19727 | self.assertEqual(cp_dir, os.path.join(root, cpm.checkpoint_dir, cp_name)) | ||
self.assertEqual(cp_subdir, os.path.join(root, subd, cpm.checkpoint_dir, cp_name)) | ||||
|
r19611 | |||
@dec.skip_win32 | ||||
def test_bad_symlink(self): | ||||
|
r19612 | with TemporaryDirectory() as td: | ||
cm = FileContentsManager(root_dir=td) | ||||
path = 'test bad symlink' | ||||
_make_dir(cm, path) | ||||
file_model = cm.new_untitled(path=path, ext='.txt') | ||||
# create a broken symlink | ||||
self.symlink(cm, "target", '%s/%s' % (path, 'bad symlink')) | ||||
model = cm.get(path) | ||||
self.assertEqual(model['content'], [file_model]) | ||||
|
r19611 | |||
@dec.skip_win32 | ||||
def test_good_symlink(self): | ||||
|
r19612 | with TemporaryDirectory() as td: | ||
cm = FileContentsManager(root_dir=td) | ||||
parent = 'test good symlink' | ||||
name = 'good symlink' | ||||
path = '{0}/{1}'.format(parent, name) | ||||
_make_dir(cm, parent) | ||||
file_model = cm.new(path=parent + '/zfoo.txt') | ||||
# create a good symlink | ||||
self.symlink(cm, file_model['path'], path) | ||||
symlink_model = cm.get(path, content=False) | ||||
dir_model = cm.get(parent) | ||||
self.assertEqual( | ||||
sorted(dir_model['content'], key=lambda x: x['name']), | ||||
[symlink_model, file_model], | ||||
) | ||||
|
r20490 | |||
def test_403(self): | ||||
if hasattr(os, 'getuid'): | ||||
if os.getuid() == 0: | ||||
raise SkipTest("Can't test permissions as root") | ||||
|
r20575 | if sys.platform.startswith('win'): | ||
raise SkipTest("Can't test permissions on Windows") | ||||
|
r20490 | |||
with TemporaryDirectory() as td: | ||||
cm = FileContentsManager(root_dir=td) | ||||
model = cm.new_untitled(type='file') | ||||
os_path = cm._get_os_path(model['path']) | ||||
os.chmod(os_path, 0o400) | ||||
try: | ||||
with cm.open(os_path, 'w') as f: | ||||
f.write(u"don't care") | ||||
except HTTPError as e: | ||||
self.assertEqual(e.status_code, 403) | ||||
else: | ||||
self.fail("Should have raised HTTPError(403)") | ||||
|
r17523 | |||
|
r20743 | def test_escape_root(self): | ||
with TemporaryDirectory() as td: | ||||
cm = FileContentsManager(root_dir=td) | ||||
# make foo, bar next to root | ||||
with open(os.path.join(cm.root_dir, '..', 'foo'), 'w') as f: | ||||
f.write('foo') | ||||
with open(os.path.join(cm.root_dir, '..', 'bar'), 'w') as f: | ||||
f.write('bar') | ||||
with self.assertRaisesHTTPError(404): | ||||
cm.get('..') | ||||
with self.assertRaisesHTTPError(404): | ||||
cm.get('foo/../../../bar') | ||||
with self.assertRaisesHTTPError(404): | ||||
cm.delete('../foo') | ||||
with self.assertRaisesHTTPError(404): | ||||
cm.rename('../foo', '../bar') | ||||
with self.assertRaisesHTTPError(404): | ||||
cm.save(model={ | ||||
'type': 'file', | ||||
'content': u'', | ||||
'format': 'text', | ||||
}, path='../foo') | ||||
|
r13032 | |||
|
r17525 | class TestContentsManager(TestCase): | ||
|
r19604 | |||
|
r15655 | def setUp(self): | ||
self._temp_dir = TemporaryDirectory() | ||||
self.td = self._temp_dir.name | ||||
|
r17524 | self.contents_manager = FileContentsManager( | ||
root_dir=self.td, | ||||
|
r15656 | ) | ||
|
r17523 | |||
|
r15655 | def tearDown(self): | ||
self._temp_dir.cleanup() | ||||
|
r20658 | |||
|
r19604 | def make_dir(self, api_path): | ||
|
r19674 | """make a subdirectory at api_path | ||
override in subclasses if contents are not on the filesystem. | ||||
""" | ||||
|
r19612 | _make_dir(self.contents_manager, api_path) | ||
|
r17523 | |||
|
r15655 | def add_code_cell(self, nb): | ||
|
r18607 | output = nbformat.new_output("display_data", {'application/javascript': "alert('hi');"}) | ||
cell = nbformat.new_code_cell("print('hi')", outputs=[output]) | ||||
|
r18584 | nb.cells.append(cell) | ||
|
r17523 | |||
|
r15655 | def new_notebook(self): | ||
|
r17524 | cm = self.contents_manager | ||
|
r18759 | model = cm.new_untitled(type='notebook') | ||
|
r15655 | name = model['name'] | ||
path = model['path'] | ||||
|
r17523 | |||
|
r18791 | full_model = cm.get(path) | ||
|
r15655 | nb = full_model['content'] | ||
|
r19628 | nb['metadata']['counter'] = int(1e6 * time.time()) | ||
|
r15655 | self.add_code_cell(nb) | ||
|
r17523 | |||
|
r18749 | cm.save(full_model, path) | ||
|
r15655 | return nb, name, path | ||
|
r17523 | |||
|
r18759 | def test_new_untitled(self): | ||
|
r17524 | cm = self.contents_manager | ||
|
r15656 | # Test in root directory | ||
|
r18759 | model = cm.new_untitled(type='notebook') | ||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
|
r18759 | self.assertIn('type', model) | ||
self.assertEqual(model['type'], 'notebook') | ||||
|
r18813 | self.assertEqual(model['name'], 'Untitled.ipynb') | ||
self.assertEqual(model['path'], 'Untitled.ipynb') | ||||
|
r15656 | |||
# Test in sub-directory | ||||
|
r18759 | model = cm.new_untitled(type='directory') | ||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
|
r18759 | self.assertIn('type', model) | ||
self.assertEqual(model['type'], 'directory') | ||||
|
r18813 | self.assertEqual(model['name'], 'Untitled Folder') | ||
self.assertEqual(model['path'], 'Untitled Folder') | ||||
|
r18759 | sub_dir = model['path'] | ||
model = cm.new_untitled(path=sub_dir) | ||||
assert isinstance(model, dict) | ||||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
self.assertIn('type', model) | ||||
self.assertEqual(model['type'], 'file') | ||||
|
r18813 | self.assertEqual(model['name'], 'untitled') | ||
self.assertEqual(model['path'], '%s/untitled' % sub_dir) | ||||
|
r13046 | |||
|
r20882 | def test_modified_date(self): | ||
cm = self.contents_manager | ||||
# Create a new notebook. | ||||
nb, name, path = self.new_notebook() | ||||
model = cm.get(path) | ||||
# Add a cell and save. | ||||
self.add_code_cell(model['content']) | ||||
cm.save(model, path) | ||||
# Reload notebook and verify that last_modified incremented. | ||||
saved = cm.get(path) | ||||
self.assertGreater(saved['last_modified'], model['last_modified']) | ||||
# Move the notebook and verify that last_modified stayed the same. | ||||
# (The frontend fires a warning if last_modified increases on the | ||||
# renamed file.) | ||||
new_path = 'renamed.ipynb' | ||||
cm.rename(path, new_path) | ||||
renamed = cm.get(new_path) | ||||
self.assertGreaterEqual( | ||||
renamed['last_modified'], | ||||
saved['last_modified'], | ||||
) | ||||
|
r17524 | def test_get(self): | ||
cm = self.contents_manager | ||||
|
r15656 | # Create a notebook | ||
|
r18759 | model = cm.new_untitled(type='notebook') | ||
|
r15656 | name = model['name'] | ||
path = model['path'] | ||||
# Check that we 'get' on the notebook we just created | ||||
|
r18791 | model2 = cm.get(path) | ||
|
r15656 | assert isinstance(model2, dict) | ||
self.assertIn('name', model2) | ||||
self.assertIn('path', model2) | ||||
self.assertEqual(model['name'], name) | ||||
self.assertEqual(model['path'], path) | ||||
|
r19391 | nb_as_file = cm.get(path, content=True, type='file') | ||
|
r18781 | self.assertEqual(nb_as_file['path'], path) | ||
self.assertEqual(nb_as_file['type'], 'file') | ||||
self.assertEqual(nb_as_file['format'], 'text') | ||||
self.assertNotIsInstance(nb_as_file['content'], dict) | ||||
|
r19391 | nb_as_bin_file = cm.get(path, content=True, type='file', format='base64') | ||
|
r18788 | self.assertEqual(nb_as_bin_file['format'], 'base64') | ||
|
r15656 | # Test in sub-directory | ||
sub_dir = '/foo/' | ||||
|
r19604 | self.make_dir('foo') | ||
|
r18759 | model = cm.new_untitled(path=sub_dir, ext='.ipynb') | ||
|
r18791 | model2 = cm.get(sub_dir + name) | ||
|
r15656 | assert isinstance(model2, dict) | ||
self.assertIn('name', model2) | ||||
self.assertIn('path', model2) | ||||
self.assertIn('content', model2) | ||||
|
r18813 | self.assertEqual(model2['name'], 'Untitled.ipynb') | ||
|
r18749 | self.assertEqual(model2['path'], '{0}/{1}'.format(sub_dir.strip('/'), name)) | ||
|
r18781 | |||
|
r19618 | # Test with a regular file. | ||
file_model_path = cm.new_untitled(path=sub_dir, ext='.txt')['path'] | ||||
file_model = cm.get(file_model_path) | ||||
self.assertDictContainsSubset( | ||||
{ | ||||
'content': u'', | ||||
|
r19619 | 'format': u'text', | ||
|
r19618 | 'mimetype': u'text/plain', | ||
'name': u'untitled.txt', | ||||
'path': u'foo/untitled.txt', | ||||
'type': u'file', | ||||
'writable': True, | ||||
}, | ||||
file_model, | ||||
) | ||||
self.assertIn('created', file_model) | ||||
self.assertIn('last_modified', file_model) | ||||
|
r18781 | # Test getting directory model | ||
|
r19609 | |||
# Create a sub-sub directory to test getting directory contents with a | ||||
# subdir. | ||||
|
r19610 | self.make_dir('foo/bar') | ||
|
r18791 | dirmodel = cm.get('foo') | ||
|
r18781 | self.assertEqual(dirmodel['type'], 'directory') | ||
|
r19609 | self.assertIsInstance(dirmodel['content'], list) | ||
|
r19618 | self.assertEqual(len(dirmodel['content']), 3) | ||
|
r19610 | self.assertEqual(dirmodel['path'], 'foo') | ||
self.assertEqual(dirmodel['name'], 'foo') | ||||
|
r19609 | |||
# Directory contents should match the contents of each individual entry | ||||
# when requested with content=False. | ||||
model2_no_content = cm.get(sub_dir + name, content=False) | ||||
|
r19618 | file_model_no_content = cm.get(u'foo/untitled.txt', content=False) | ||
|
r19610 | sub_sub_dir_no_content = cm.get('foo/bar', content=False) | ||
self.assertEqual(sub_sub_dir_no_content['path'], 'foo/bar') | ||||
self.assertEqual(sub_sub_dir_no_content['name'], 'bar') | ||||
|
r19609 | for entry in dirmodel['content']: | ||
# Order isn't guaranteed by the spec, so this is a hacky way of | ||||
# verifying that all entries are matched. | ||||
if entry['path'] == sub_sub_dir_no_content['path']: | ||||
self.assertEqual(entry, sub_sub_dir_no_content) | ||||
elif entry['path'] == model2_no_content['path']: | ||||
self.assertEqual(entry, model2_no_content) | ||||
|
r19618 | elif entry['path'] == file_model_no_content['path']: | ||
self.assertEqual(entry, file_model_no_content) | ||||
|
r19609 | else: | ||
self.fail("Unexpected directory entry: %s" % entry()) | ||||
|
r18781 | |||
with self.assertRaises(HTTPError): | ||||
|
r19391 | cm.get('foo', type='file') | ||
|
r18781 | |||
|
r17524 | def test_update(self): | ||
cm = self.contents_manager | ||||
|
r15656 | # Create a notebook | ||
|
r18759 | model = cm.new_untitled(type='notebook') | ||
|
r15656 | name = model['name'] | ||
path = model['path'] | ||||
# Change the name in the model for rename | ||||
|
r18749 | model['path'] = 'test.ipynb' | ||
model = cm.update(model, path) | ||||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
self.assertEqual(model['name'], 'test.ipynb') | ||||
# Make sure the old name is gone | ||||
|
r18791 | self.assertRaises(HTTPError, cm.get, path) | ||
|
r15656 | |||
# Test in sub-directory | ||||
# Create a directory and notebook in that directory | ||||
sub_dir = '/foo/' | ||||
|
r19604 | self.make_dir('foo') | ||
|
r18759 | model = cm.new_untitled(path=sub_dir, type='notebook') | ||
|
r15656 | path = model['path'] | ||
|
r17523 | |||
|
r15656 | # Change the name in the model for rename | ||
|
r18749 | d = path.rsplit('/', 1)[0] | ||
new_path = model['path'] = d + '/test_in_sub.ipynb' | ||||
model = cm.update(model, path) | ||||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
self.assertEqual(model['name'], 'test_in_sub.ipynb') | ||||
|
r18749 | self.assertEqual(model['path'], new_path) | ||
|
r17523 | |||
|
r15656 | # Make sure the old name is gone | ||
|
r18791 | self.assertRaises(HTTPError, cm.get, path) | ||
|
r13046 | |||
|
r17524 | def test_save(self): | ||
cm = self.contents_manager | ||||
|
r15656 | # Create a notebook | ||
|
r18759 | model = cm.new_untitled(type='notebook') | ||
|
r15656 | name = model['name'] | ||
path = model['path'] | ||||
# Get the model with 'content' | ||||
|
r18791 | full_model = cm.get(path) | ||
|
r15656 | |||
# Save the notebook | ||||
|
r18749 | model = cm.save(full_model, path) | ||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
self.assertEqual(model['name'], name) | ||||
self.assertEqual(model['path'], path) | ||||
# Test in sub-directory | ||||
# Create a directory and notebook in that directory | ||||
sub_dir = '/foo/' | ||||
|
r19604 | self.make_dir('foo') | ||
|
r18759 | model = cm.new_untitled(path=sub_dir, type='notebook') | ||
|
r15656 | name = model['name'] | ||
path = model['path'] | ||||
|
r18791 | model = cm.get(path) | ||
|
r15656 | |||
# Change the name in the model for rename | ||||
|
r18749 | model = cm.save(model, path) | ||
|
r15656 | assert isinstance(model, dict) | ||
self.assertIn('name', model) | ||||
self.assertIn('path', model) | ||||
|
r18813 | self.assertEqual(model['name'], 'Untitled.ipynb') | ||
self.assertEqual(model['path'], 'foo/Untitled.ipynb') | ||||
|
r13046 | |||
|
r17524 | def test_delete(self): | ||
cm = self.contents_manager | ||||
|
r15656 | # Create a notebook | ||
nb, name, path = self.new_notebook() | ||||
|
r17523 | |||
|
r15656 | # Delete the notebook | ||
|
r18749 | cm.delete(path) | ||
|
r17523 | |||
|
r19608 | # Check that deleting a non-existent path raises an error. | ||
self.assertRaises(HTTPError, cm.delete, path) | ||||
|
r15656 | # Check that a 'get' on the deleted notebook raises and error | ||
|
r18791 | self.assertRaises(HTTPError, cm.get, path) | ||
|
r17523 | |||
|
r17524 | def test_copy(self): | ||
cm = self.contents_manager | ||||
|
r18749 | parent = u'Ã¥ b' | ||
|
r15656 | name = u'nb √.ipynb' | ||
|
r18749 | path = u'{0}/{1}'.format(parent, name) | ||
|
r19604 | self.make_dir(parent) | ||
|
r17523 | |||
|
r19608 | orig = cm.new(path=path) | ||
|
r15656 | # copy with unspecified name | ||
|
r18749 | copy = cm.copy(path) | ||
|
r18813 | self.assertEqual(copy['name'], orig['name'].replace('.ipynb', '-Copy1.ipynb')) | ||
|
r17523 | |||
|
r15656 | # copy with specified name | ||
|
r18749 | copy2 = cm.copy(path, u'Ã¥ b/copy 2.ipynb') | ||
|
r15656 | self.assertEqual(copy2['name'], u'copy 2.ipynb') | ||
|
r18749 | self.assertEqual(copy2['path'], u'Ã¥ b/copy 2.ipynb') | ||
|
r18813 | # copy with specified path | ||
copy2 = cm.copy(path, u'/') | ||||
self.assertEqual(copy2['name'], name) | ||||
self.assertEqual(copy2['path'], name) | ||||
|
r17523 | |||
|
r15655 | def test_trust_notebook(self): | ||
|
r17524 | cm = self.contents_manager | ||
|
r15655 | nb, name, path = self.new_notebook() | ||
|
r17523 | |||
|
r18791 | untrusted = cm.get(path)['content'] | ||
|
r17524 | assert not cm.notary.check_cells(untrusted) | ||
|
r17523 | |||
|
r15656 | # print(untrusted) | ||
|
r18749 | cm.trust_notebook(path) | ||
|
r18791 | trusted = cm.get(path)['content'] | ||
|
r15656 | # print(trusted) | ||
|
r17524 | assert cm.notary.check_cells(trusted) | ||
|
r17523 | |||
|
r15655 | def test_mark_trusted_cells(self): | ||
|
r17524 | cm = self.contents_manager | ||
|
r15655 | nb, name, path = self.new_notebook() | ||
|
r17523 | |||
|
r18749 | cm.mark_trusted_cells(nb, path) | ||
|
r18584 | for cell in nb.cells: | ||
|
r15655 | if cell.cell_type == 'code': | ||
|
r18255 | assert not cell.metadata.trusted | ||
|
r17523 | |||
|
r18749 | cm.trust_notebook(path) | ||
|
r18791 | nb = cm.get(path)['content'] | ||
|
r18584 | for cell in nb.cells: | ||
|
r15655 | if cell.cell_type == 'code': | ||
|
r18255 | assert cell.metadata.trusted | ||
|
r15655 | |||
def test_check_and_sign(self): | ||||
|
r17524 | cm = self.contents_manager | ||
|
r15655 | nb, name, path = self.new_notebook() | ||
|
r17523 | |||
|
r18749 | cm.mark_trusted_cells(nb, path) | ||
cm.check_and_sign(nb, path) | ||||
|
r17524 | assert not cm.notary.check_signature(nb) | ||
|
r17523 | |||
|
r18749 | cm.trust_notebook(path) | ||
|
r18791 | nb = cm.get(path)['content'] | ||
|
r18749 | cm.mark_trusted_cells(nb, path) | ||
cm.check_and_sign(nb, path) | ||||
|
r17524 | assert cm.notary.check_signature(nb) | ||