add a few tests

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2014-12-09 01:23:02 +00:00
parent ab4ca301ab
commit d1d8bd5356
1 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@ var (
ExecutionDriver: "execution-driver-test",
KernelVersion: "1.2.3",
OperatingSystem: "golang",
Labels: []string{"foo=bar"},
}
)
@ -60,6 +61,7 @@ func TestNodeSpecs(t *testing.T) {
assert.NoError(t, node.connectClient(client))
assert.True(t, node.IsConnected())
assert.True(t, node.IsHealthy())
assert.Equal(t, node.Cpus, mockInfo.NCPU)
assert.Equal(t, node.Memory, mockInfo.MemTotal)
@ -67,6 +69,7 @@ func TestNodeSpecs(t *testing.T) {
assert.Equal(t, node.Labels["executiondriver"], mockInfo.ExecutionDriver)
assert.Equal(t, node.Labels["kernelversion"], mockInfo.KernelVersion)
assert.Equal(t, node.Labels["operatingsystem"], mockInfo.OperatingSystem)
assert.Equal(t, node.Labels["foo"], "bar")
client.Mock.AssertExpectations(t)
}