github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/integration-cli/docker_api_version_test.go (about) 1 package main 2 3 import ( 4 "encoding/json" 5 "net/http" 6 7 "github.com/docker/docker/dockerversion" 8 "github.com/docker/docker/pkg/integration/checker" 9 "github.com/docker/engine-api/types" 10 "github.com/go-check/check" 11 ) 12 13 func (s *DockerSuite) TestGetVersion(c *check.C) { 14 status, body, err := sockRequest("GET", "/version", nil) 15 c.Assert(status, checker.Equals, http.StatusOK) 16 c.Assert(err, checker.IsNil) 17 18 var v types.Version 19 20 c.Assert(json.Unmarshal(body, &v), checker.IsNil) 21 22 c.Assert(v.Version, checker.Equals, dockerversion.Version, check.Commentf("Version mismatch")) 23 }