You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
455 B
23 lines
455 B
package util
|
|
|
|
import (
|
|
"github.com/dustin/go-humanize"
|
|
"testing"
|
|
)
|
|
|
|
func TestParseVolumeSizeLimit(t *testing.T) {
|
|
volumeSizeLimit := ParseVolumeSizeLimit(10, "")
|
|
if volumeSizeLimit != 10*humanize.MiByte {
|
|
t.Fail()
|
|
}
|
|
|
|
volumeSizeLimit = ParseVolumeSizeLimit(10, "11GiB")
|
|
if volumeSizeLimit != 11*humanize.GiByte {
|
|
t.Fail()
|
|
}
|
|
|
|
volumeSizeLimit = ParseVolumeSizeLimit(10, "11811160064")
|
|
if volumeSizeLimit != 11*humanize.GiByte {
|
|
t.Fail()
|
|
}
|
|
}
|