- DisplayablePorts is a `cli` function, moving to `docker/cli` - Move MatchesContentType to the only package using it, `api/server/httputils` (and remove the deps on logrus for `api` package) Signed-off-by: Vincent Demeester <vincent@sbr.pm> Upstream-commit: 565aa41392b01251dfc9398eb69c23bdd8ea64e6 Component: engine
19 lines
364 B
Go
19 lines
364 B
Go
package httputils
|
|
|
|
import "testing"
|
|
|
|
// matchesContentType
|
|
func TestJsonContentType(t *testing.T) {
|
|
if !matchesContentType("application/json", "application/json") {
|
|
t.Fail()
|
|
}
|
|
|
|
if !matchesContentType("application/json; charset=utf-8", "application/json") {
|
|
t.Fail()
|
|
}
|
|
|
|
if matchesContentType("dockerapplication/json", "application/json") {
|
|
t.Fail()
|
|
}
|
|
}
|