mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
api: BucketNotification should disallow duplicate notification. (#2539)
Added checks to look for duplicated notification configs. Fixes #2472
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user