mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 16:40:08 -03:00
add TestGetMimeType
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
This commit is contained in:
parent
f9c6cbabb1
commit
66fda9af16
@ -92,6 +92,24 @@ func (s *EnryTestSuite) TestIsImage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *EnryTestSuite) TestGetMimeType() {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
path string
|
||||||
|
lang string
|
||||||
|
expected string
|
||||||
|
}{
|
||||||
|
{name: "TestGetMimeType_1", path: "text.txt", lang: "", expected: "text/plain"},
|
||||||
|
{name: "TestGetMimeType_2", path: "file.go", lang: "Go", expected: "text/x-go"},
|
||||||
|
{name: "TestGetMimeType_3", path: "image.png", lang: "", expected: "image/png"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
is := GetMimeType(test.path, test.lang)
|
||||||
|
assert.Equal(s.T(), is, test.expected, fmt.Sprintf("%v: is = %v, expected: %v", test.name, is, test.expected))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *EnryTestSuite) TestIsConfiguration() {
|
func (s *EnryTestSuite) TestIsConfiguration() {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user