diff --git a/IPython/html/services/notebooks/tests/test_notebooks_api.py b/IPython/html/services/notebooks/tests/test_notebooks_api.py index d5f1c56..d1c6408 100644 --- a/IPython/html/services/notebooks/tests/test_notebooks_api.py +++ b/IPython/html/services/notebooks/tests/test_notebooks_api.py @@ -42,6 +42,9 @@ class NBAPI(object): def upload(self, name, body, path='/'): return self._req('POST', url_path_join(path, name), body) + def copy(self, name, path='/'): + return self._req('POST', url_path_join(path, name, 'copy')) + def save(self, name, body, path='/'): return self._req('PUT', url_path_join(path, name), body) @@ -153,6 +156,10 @@ class APITest(NotebookTestBase): body=jsonapi.dumps(nbmodel)) self._check_nb_created(resp, 'Upload test.ipynb', 'foo') + def test_copy(self): + resp = self.nb_api.copy('a.ipynb', path='foo') + self._check_nb_created(resp, 'a-Copy0.ipynb', 'foo') + def test_delete(self): for d, name in self.dirs_nbs: resp = self.nb_api.delete('%s.ipynb' % name, d)