summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2022-08-14 21:34:30 +0300
committerMarin Ivanov <[email protected]>2022-08-14 21:34:30 +0300
commit265ad9870e5b1b3ea08b0f6cd6edce014fea251c (patch)
tree18607ac34ac2f2eb2dcf7ea4b0e7d86e11ca753c
parenta9f40b0386b702b8afda3b45c1cb2ec736bf9911 (diff)
Test non-existent file error tranformation
-rw-r--r--fs_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs_test.go b/fs_test.go
index b6906fa..cb1d7ba 100644
--- a/fs_test.go
+++ b/fs_test.go
@@ -4,6 +4,7 @@ import (
"testing"
"github.com/matryer/is"
+ "github.com/spf13/afero"
)
func TestFsListBuckets(t *testing.T) {
@@ -40,6 +41,14 @@ func TestFsStat(t *testing.T) {
is.Equal(info.Name(), "file")
}
+func TestFsStatNoExist(t *testing.T) {
+ is := is.New(t)
+ fs, err := newTestFs()
+ is.NoErr(err)
+ _, err = fs.Stat("dir/non-existent")
+ is.Equal(err, afero.ErrFileNotFound)
+}
+
func newTestFs() (*Fs, error) {
fs, err := NewFs("127.0.0.1:9000", "test-bucket", "testuser", "testsecret", false)
return fs, err