Increased test coverage of httputils to 70 %
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com> (cherry picked from commit d71817464e859cd323d6cdaf4dec5a9dd530f57e)
This commit is contained in:
parent
7e6418c6b1
commit
46454090b6
2 changed files with 73 additions and 0 deletions
14
httputils/mimetype_test.go
Normal file
14
httputils/mimetype_test.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package httputils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDetectContentType(t *testing.T) {
|
||||
input := []byte("That is just a plain text")
|
||||
|
||||
contentType, _, err := DetectContentType(input)
|
||||
if err != nil || contentType != "text/plain" {
|
||||
t.Errorf("TestDetectContentType failed")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue