Bladeren bron

Updated GetCustomCostAccumulateOption unit tests.

Signed-off-by: Nik Willwerth <nwillwerth@kubecost.com>
Nik Willwerth 2 jaren geleden
bovenliggende
commit
c07766cd5c
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      pkg/customcost/repositoryquerier_test.go

+ 3 - 3
pkg/customcost/repositoryquerier_test.go

@@ -52,8 +52,8 @@ func TestGetCustomCostAccumulateOption(t *testing.T) {
 		"out of range": {
 			window:  opencost.NewClosedWindow(midnight.Add(-timeutil.Day*120), midnight.Add(-timeutil.Day*30)),
 			from:    nil,
-			want:    opencost.AccumulateOptionNone,
-			wantErr: true,
+			want:    opencost.AccumulateOptionDay,
+			wantErr: false,
 		},
 		"daily from daily, monthly": {
 			window: opencost.NewClosedWindow(nextHour.Add(-time.Hour*24), nextHour),
@@ -67,7 +67,7 @@ func TestGetCustomCostAccumulateOption(t *testing.T) {
 	}
 	for name, tt := range tests {
 		t.Run(name, func(t *testing.T) {
-			got, err := getCustomCostAccumulateOption(tt.window, tt.from)
+			got, err := GetCustomCostAccumulateOption(tt.window, tt.from)
 			if (err != nil) != tt.wantErr {
 				t.Errorf("GetAccumulateOption() error = %v, wantErr %v", err, tt.wantErr)
 				return