api: BucketNotification should disallow duplicate notification. (#2539)

Added checks to look for duplicated notification configs.

Fixes #2472
This commit is contained in:
Harshavardhana
2016-08-23 18:42:30 -07:00
committed by GitHub
parent c39d3db7a0
commit ec4260d260
6 changed files with 113 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
/*
* mime-db: Mime Database, (C) 2015 Minio, Inc.
* mime-db: Mime Database, (C) 2015, 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +14,18 @@
* limitations under the License.
*/
package mimedb_test
package mimedb
import (
"testing"
import "testing"
"github.com/minio/minio/pkg/mimedb"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestLookup(c *C) {
// Test MustLookup.
contentType := mimedb.DB["exe"].ContentType
c.Assert(contentType, Not(Equals), "")
func TestMimeLookup(t *testing.T) {
// Test mimeLookup.
contentType := DB["txt"].ContentType
if contentType != "text/plain" {
t.Fatalf("Invalid content type are found expected \"application/x-msdownload\", got %s", contentType)
}
compressible := DB["txt"].Compressible
if compressible != false {
t.Fatalf("Invalid content type are found expected \"false\", got %t", compressible)
}
}