##// END OF EJS Templates
Add test for copying notebook through REST API
Thomas Kluyver -
Show More
@@ -42,6 +42,9 b' class NBAPI(object):'
42 42 def upload(self, name, body, path='/'):
43 43 return self._req('POST', url_path_join(path, name), body)
44 44
45 def copy(self, name, path='/'):
46 return self._req('POST', url_path_join(path, name, 'copy'))
47
45 48 def save(self, name, body, path='/'):
46 49 return self._req('PUT', url_path_join(path, name), body)
47 50
@@ -153,6 +156,10 b' class APITest(NotebookTestBase):'
153 156 body=jsonapi.dumps(nbmodel))
154 157 self._check_nb_created(resp, 'Upload test.ipynb', 'foo')
155 158
159 def test_copy(self):
160 resp = self.nb_api.copy('a.ipynb', path='foo')
161 self._check_nb_created(resp, 'a-Copy0.ipynb', 'foo')
162
156 163 def test_delete(self):
157 164 for d, name in self.dirs_nbs:
158 165 resp = self.nb_api.delete('%s.ipynb' % name, d)
General Comments 0
You need to be logged in to leave comments. Login now