mirror of https://github.com/docker/cli.git
Merge a418c68e38
into 9c01d924fb
This commit is contained in:
commit
266a0027ed
|
@ -248,7 +248,7 @@ func (c *imageContext) CreatedAt() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *imageContext) Size() string {
|
func (c *imageContext) Size() string {
|
||||||
return units.HumanSizeWithPrecision(float64(c.i.Size), 3)
|
return units.HumanSize(float64(c.i.Size))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *imageContext) Containers() string {
|
func (c *imageContext) Containers() string {
|
||||||
|
|
|
@ -40,6 +40,11 @@ func TestImageContext(t *testing.T) {
|
||||||
expValue: "10B",
|
expValue: "10B",
|
||||||
call: ctx.Size,
|
call: ctx.Size,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
imageCtx: imageContext{i: types.ImageSummary{Size: 999900000}, trunc: true},
|
||||||
|
expValue: "999.9MB",
|
||||||
|
call: ctx.Size,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
imageCtx: imageContext{i: image.Summary{Created: unix}, trunc: true},
|
imageCtx: imageContext{i: image.Summary{Created: unix}, trunc: true},
|
||||||
expValue: time.Unix(unix, 0).String(), call: ctx.CreatedAt,
|
expValue: time.Unix(unix, 0).String(), call: ctx.CreatedAt,
|
||||||
|
|
Loading…
Reference in New Issue