mimetype_test.go 334 B

12345678910111213141516
  1. package remotecontext
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. "github.com/stretchr/testify/require"
  6. )
  7. func TestDetectContentType(t *testing.T) {
  8. input := []byte("That is just a plain text")
  9. contentType, _, err := detectContentType(input)
  10. require.NoError(t, err)
  11. assert.Equal(t, "text/plain", contentType)
  12. }