Fixed TestGetInfoForBytes to work on all platforms (#3832)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
e5a3e55737
Коммит
ac7ead09e2
@@ -6,6 +6,7 @@ package model
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ func TestGetInfoForBytes(t *testing.T) {
|
|||||||
t.Fatalf("Got incorrect size: %v", info.Size)
|
t.Fatalf("Got incorrect size: %v", info.Size)
|
||||||
} else if info.Extension != "txt" {
|
} else if info.Extension != "txt" {
|
||||||
t.Fatalf("Got incorrect file extension: %v", info.Extension)
|
t.Fatalf("Got incorrect file extension: %v", info.Extension)
|
||||||
} else if info.MimeType != "text/plain; charset=utf-8" {
|
} else if !strings.HasPrefix(info.MimeType, "text/plain") {
|
||||||
t.Fatalf("Got incorrect mime type: %v", info.MimeType)
|
t.Fatalf("Got incorrect mime type: %v", info.MimeType)
|
||||||
} else if info.HasPreviewImage {
|
} else if info.HasPreviewImage {
|
||||||
t.Fatalf("Got HasPreviewImage = true for non-image file")
|
t.Fatalf("Got HasPreviewImage = true for non-image file")
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user