##// 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 def upload(self, name, body, path='/'):
42 def upload(self, name, body, path='/'):
43 return self._req('POST', url_path_join(path, name), body)
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 def save(self, name, body, path='/'):
48 def save(self, name, body, path='/'):
46 return self._req('PUT', url_path_join(path, name), body)
49 return self._req('PUT', url_path_join(path, name), body)
47
50
@@ -153,6 +156,10 b' class APITest(NotebookTestBase):'
153 body=jsonapi.dumps(nbmodel))
156 body=jsonapi.dumps(nbmodel))
154 self._check_nb_created(resp, 'Upload test.ipynb', 'foo')
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 def test_delete(self):
163 def test_delete(self):
157 for d, name in self.dirs_nbs:
164 for d, name in self.dirs_nbs:
158 resp = self.nb_api.delete('%s.ipynb' % name, d)
165 resp = self.nb_api.delete('%s.ipynb' % name, d)
General Comments 0
You need to be logged in to leave comments. Login now