mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
a0bf80fe03
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
24 lines
433 B
Go
24 lines
433 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/autogen/dockerversion"
|
|
)
|
|
|
|
func TestGetVersion(t *testing.T) {
|
|
_, body, err := sockRequest("GET", "/version", nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
var v types.Version
|
|
if err := json.Unmarshal(body, &v); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if v.Version != dockerversion.VERSION {
|
|
t.Fatal("Version mismatch")
|
|
}
|
|
}
|