1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cli/command/container/stats_unit_test.go
Boaz Shuster 96622b2a7d Add the format switch to the stats command
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2016-09-18 14:16:13 +03:00

20 lines
483 B
Go

package container
import (
"testing"
"github.com/docker/docker/api/types"
)
func TestCalculBlockIO(t *testing.T) {
blkio := types.BlkioStats{
IoServiceBytesRecursive: []types.BlkioStatEntry{{8, 0, "read", 1234}, {8, 1, "read", 4567}, {8, 0, "write", 123}, {8, 1, "write", 456}},
}
blkRead, blkWrite := calculateBlockIO(blkio)
if blkRead != 5801 {
t.Fatalf("blkRead = %d, want 5801", blkRead)
}
if blkWrite != 579 {
t.Fatalf("blkWrite = %d, want 579", blkWrite)
}
}