Merge pull request #4601 from minrk/test-rename-existing

test that rename fails with 409 if it would clobber
This commit is contained in:
Thomas Kluyver 2013-11-26 11:03:59 -08:00
commit 0c804c2dae

View File

@ -245,6 +245,10 @@ class APITest(NotebookTestBase):
self.assertIn('z.ipynb', nbnames) self.assertIn('z.ipynb', nbnames)
self.assertNotIn('a.ipynb', nbnames) self.assertNotIn('a.ipynb', nbnames)
def test_rename_existing(self):
with assert_http_error(409):
self.nb_api.rename('a.ipynb', 'foo', 'b.ipynb')
def test_save(self): def test_save(self):
resp = self.nb_api.read('a.ipynb', 'foo') resp = self.nb_api.read('a.ipynb', 'foo')
nbcontent = json.loads(resp.text)['content'] nbcontent = json.loads(resp.text)['content']