Make default format right for nil values

This commit is contained in:
derekwaynecarr
2016-02-11 13:49:49 -05:00
parent acb160739f
commit a03361bd84
3 changed files with 22 additions and 14 deletions

View File

@@ -51,3 +51,13 @@ func TestResourceHelpers(t *testing.T) {
t.Errorf("expected memorylimit %v, got %v", memoryLimit, res)
}
}
func TestDefaultResourceHelpers(t *testing.T) {
resourceList := ResourceList{}
if resourceList.Cpu().Format != resource.DecimalSI {
t.Errorf("expected %v, actual %v", resource.DecimalSI, resourceList.Cpu().Format)
}
if resourceList.Memory().Format != resource.BinarySI {
t.Errorf("expected %v, actual %v", resource.BinarySI, resourceList.Memory().Format)
}
}