photoprism/pkg/fs/mime_test.go
Michael Mayer a4e2867c86 Split import command into copy and move
Upgraded JS dependencies and did some refactoring along the way...

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-01-31 15:29:06 +01:00

20 lines
427 B
Go

package fs
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMimeType(t *testing.T) {
t.Run("jpg", func(t *testing.T) {
filename := Abs("./testdata/test.jpg")
mimeType := MimeType(filename)
assert.Equal(t, "image/jpeg", mimeType)
})
t.Run("not existing filename", func(t *testing.T) {
filename := Abs("./testdata/xxx.jpg")
mimeType := MimeType(filename)
assert.Equal(t, "", mimeType)
})
}