def test_rmdir_raises_error_if_dir_not_found(self): context = testlib.TestContext() try: context.fake_rmdir('nonexisting') raise AssertionError('No Exception raised') except OSError, e: self.assertEquals(errno.ENOENT, e.errno)
def test_rmdir_raises_exception_if_dir_is_not_empty(self): context = testlib.TestContext() context.fake_makedirs('/existing_dir/somefile') try: context.fake_rmdir('/existing_dir') raise AssertionError('No Exception raised') except OSError, e: self.assertEquals(errno.ENOTEMPTY, e.errno)