Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing non empty dirs to be deleted #3108

Merged
merged 13 commits into from
Dec 5, 2017
6 changes: 6 additions & 0 deletions notebook/services/contents/tests/test_contents_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ def test_delete_dirs(self):
listing = self.api.list('/').json()['content']
self.assertEqual(listing, [])

def test_delete_non_empty_dir(self):
# Test that non empty directory can be deleted
self.api.delete(u'å b')
# Assertion will pass only if self.api.delete does not throw and error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test doesn't have to have an assert - you can leave this off, and it will still fail if there's an error. When a test just checks that something runs without an error, that's a 'smoketest' (as in 'does this make smoke come out').

However, it would be good to check that it has actually been removed as well. Maybe copy some code from test_list_nonexistant_dir.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay. Sure, I'll make these changes!

assert True

def test_rename(self):
resp = self.api.rename('foo/a.ipynb', 'foo/z.ipynb')
self.assertEqual(resp.headers['Location'].split('/')[-1], 'z.ipynb')
Expand Down