mirror of
https://github.com/minio/minio.git
synced 2025-01-24 13:13:16 -05:00
Adding more api suite tests
This commit is contained in:
parent
8faaa2d21f
commit
39208601dc
@ -14,6 +14,7 @@ func APITestSuite(c *C, create func() Storage) {
|
||||
testPaging(c, create)
|
||||
testObjectOverwriteFails(c, create)
|
||||
testNonExistantBucketOperations(c, create)
|
||||
testBucketRecreateFails(c, create)
|
||||
}
|
||||
|
||||
func testCreateBucket(c *C, create func() Storage) {
|
||||
@ -74,8 +75,24 @@ func testPaging(c *C, create func() Storage) {
|
||||
}
|
||||
|
||||
func testObjectOverwriteFails(c *C, create func() Storage) {
|
||||
// test overwriting object fails
|
||||
storage := create()
|
||||
storage.StoreBucket("bucket")
|
||||
err := storage.StoreObject("bucket", "object", bytes.NewBufferString("one"))
|
||||
c.Assert(err, IsNil)
|
||||
err = storage.StoreObject("bucket", "object", bytes.NewBufferString("one"))
|
||||
c.Assert(err, Not(IsNil))
|
||||
}
|
||||
|
||||
func testNonExistantBucketOperations(c *C, create func() Storage) {
|
||||
// test writing object in non-existant bucket fails
|
||||
storage := create()
|
||||
err := storage.StoreObject("bucket", "object", bytes.NewBufferString("one"))
|
||||
c.Assert(err, Not(IsNil))
|
||||
}
|
||||
|
||||
func testBucketRecreateFails(c *C, create func() Storage) {
|
||||
storage := create()
|
||||
err := storage.StoreBucket("string")
|
||||
c.Assert(err, IsNil)
|
||||
err = storage.StoreBucket("string")
|
||||
c.Assert(err, Not(IsNil))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user