storage: DeleteFile should return errFileNotFound for ENOENT. (#2978)

This commit is contained in:
Harshavardhana
2016-10-17 16:38:46 -07:00
committed by GitHub
parent 0ff359ca0e
commit 8d2347bc7b
3 changed files with 10 additions and 6 deletions

View File

@@ -678,8 +678,8 @@ func TestPosixListDir(t *testing.T) {
t.Errorf("Unable to initialize posix, %s", err)
}
if err = posixStorage.DeleteFile("bin", "yes"); !os.IsPermission(err) {
t.Errorf("expected: Permission error, got: %s", err)
if err = posixStorage.DeleteFile("bin", "yes"); err != errFileAccessDenied {
t.Errorf("expected: %s, got: %s", errFileAccessDenied, err)
}
}
@@ -792,8 +792,8 @@ func TestDeleteFile(t *testing.T) {
t.Errorf("Unable to initialize posix, %s", err)
}
if err = posixStorage.DeleteFile("bin", "yes"); !os.IsPermission(err) {
t.Errorf("expected: Permission error, got: %s", err)
if err = posixStorage.DeleteFile("bin", "yes"); err != errFileAccessDenied {
t.Errorf("expected: %s, got: %s", errFileAccessDenied, err)
}
}