Files
golib/aws/object_test.go
Nicolas JUHEL 94f90d7e22 Bump to sdk aws go v2 at release v0.26.0...
Bump dependancies
Refactor / Fix aws to work with sdk-aws-go-v2 at release v0.26.0...
2020-10-02 12:43:08 +02:00

61 lines
1.3 KiB
Go

package aws_test
import (
"bytes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Object", func() {
Context("List objects", func() {
It("Must fail with invalid token -1 ", func() {
_, _, _, err := cli.Object().List("token")
Expect(err).To(HaveOccurred())
})
})
Context("Put object", func() {
It("Must fail as the bucket doesn't exists - 2", func() {
err := cli.Object().Put("object", bytes.NewReader([]byte("")))
Expect(err).To(HaveOccurred())
})
})
Context("Get object", func() {
It("Must fail as the bucket doesn't exists - 3", func() {
o, err := cli.Object().Get("object")
defer func() {
if o != nil && o.Body != nil {
_ = o.Body.Close()
}
}()
Expect(err).To(HaveOccurred())
})
})
Context("Delete object", func() {
It("Must fail as the object doesn't exists - 4", func() {
err := cli.Object().Delete("object")
Expect(err).To(HaveOccurred())
})
})
Context("Multipart Put object", func() {
It("Must fail as the bucket doesn't exists - 5", func() {
err := cli.Object().MultipartPut("object", randContent(4*1024))
Expect(err).To(HaveOccurred())
})
})
Context("Delete object", func() {
It("Must fail as the object doesn't exists - 6", func() {
err := cli.Object().Delete("object")
Expect(err).To(HaveOccurred())
})
})
})