MCPcopy
hub / github.com/fluid-cloudnative/fluid / TestTransformQuantityToGooseFSUnit

Function TestTransformQuantityToGooseFSUnit

pkg/utils/quantity_test.go:112–139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestTransformQuantityToGooseFSUnit(t *testing.T) {
113 testQuantity1 := resource.MustParse("10Gi")
114 testQuantity2 := resource.MustParse("10M")
115
116 tests := []struct {
117 name string
118 quantity *resource.Quantity
119 wantValue string
120 }{
121 {
122 name: "test1 for TransformQuantityToGooseFSUnit",
123 quantity: &testQuantity1,
124 wantValue: "10GB",
125 },
126 {
127 name: "test2 for TransformQuantityToGooseFSUnit",
128 quantity: &testQuantity2,
129 wantValue: "10M",
130 },
131 }
132 for _, tt := range tests {
133 t.Run(tt.name, func(t *testing.T) {
134 if gotValue := TransformQuantityToGooseFSUnit(tt.quantity); gotValue != tt.wantValue {
135 t.Errorf("TransformQuantityToGooseFSUnit() = %v, want %v", gotValue, tt.wantValue)
136 }
137 })
138 }
139}
140
141func TestTransformQuantityToEFCUnit(t *testing.T) {
142 testQuantity1 := resource.MustParse("10Gi")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected