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

Function TestTransformQuantityToAlluxioUnit

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

Source from the content-addressed store, hash-verified

58}
59
60func TestTransformQuantityToAlluxioUnit(t *testing.T) {
61 testQuantity1 := resource.MustParse("10Gi")
62 testQuantity2 := resource.MustParse("10M")
63
64 tests := []struct {
65 name string
66 quantity *resource.Quantity
67 wantValue string
68 }{
69 {
70 name: "test1 for TransformQuantityToAlluxioUnit",
71 quantity: &testQuantity1,
72 wantValue: "10GB",
73 },
74 {
75 name: "test2 for TransformQuantityToAlluxioUnit",
76 quantity: &testQuantity2,
77 wantValue: "10M",
78 },
79 }
80 for _, tt := range tests {
81 t.Run(tt.name, func(t *testing.T) {
82 if gotValue := TransformQuantityToAlluxioUnit(tt.quantity); gotValue != tt.wantValue {
83 t.Errorf("TransformQuantityToAlluxioUnit() = %v, want %v", gotValue, tt.wantValue)
84 }
85 })
86 }
87}
88
89func TestTransformQuantityToJindoUnit(t *testing.T) {
90 testQuantity1 := resource.MustParse("5Gi")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected