def test_rmdir_twice_should_fail(): d = filepath() os.mkdir(d) os.rmdir(d) assert_raises(OSError, os.rmdir, d)
def test_rmdir_should_only_remove_empty_dirs(): d = filepath() os.mkdir(d) os.mkdir(filepath(d, "1")) assert_raises(OSError, os.rmdir, d)
def test_rmdir(): d = filepath() os.mkdir(d) os.rmdir(d) assert_false(os.path.exists(d), "exists(%s)" % d)
def test_mkdir_should_work_recursively(): d = filepath() os.mkdir(d) os.mkdir(filepath(d, "1")) assert_equals(os.listdir(d), ["1"])
def test_mkdir_should_create_empty_directory(): d = filepath() os.mkdir(d) assert_equals(os.listdir(d), [])
def test_mkdir(): d = filepath() os.mkdir(d) assert_true(os.path.isdir(d), u"¬ isdir(%s)" % d)