diff options
| author | Marin Ivanov <[email protected]> | 2022-08-14 21:34:30 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2022-08-14 21:34:30 +0300 |
| commit | 265ad9870e5b1b3ea08b0f6cd6edce014fea251c (patch) | |
| tree | 18607ac34ac2f2eb2dcf7ea4b0e7d86e11ca753c | |
| parent | a9f40b0386b702b8afda3b45c1cb2ec736bf9911 (diff) | |
Test non-existent file error tranformation
| -rw-r--r-- | fs_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |
