diff options
| -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 |
