github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/builder/remotecontext/mimetype_test.go (about)

     1  package remotecontext // import "github.com/demonoid81/moby/builder/remotecontext"
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gotest.tools/v3/assert"
     7  	is "gotest.tools/v3/assert/cmp"
     8  )
     9  
    10  func TestDetectContentType(t *testing.T) {
    11  	input := []byte("That is just a plain text")
    12  
    13  	contentType, _, err := detectContentType(input)
    14  	assert.NilError(t, err)
    15  	assert.Check(t, is.Equal("text/plain", contentType))
    16  }