Преглед изворни кода

Added unit test for (and (none)) behavior

Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Michael Dresser пре 3 година
родитељ
комит
0e004f7a87
1 измењених фајлова са 15 додато и 0 уклоњено
  1. 15 0
      pkg/kubecost/allocationfilter_test.go

+ 15 - 0
pkg/kubecost/allocationfilter_test.go

@@ -838,6 +838,21 @@ func Test_AllocationFilterAnd_Matches(t *testing.T) {
 			}},
 			expected: false,
 		},
+		{
+			name: `(and none) matches nothing`,
+			a: &Allocation{
+				Properties: &AllocationProperties{
+					Namespace: "kube-system",
+					Labels: map[string]string{
+						"app": "bar",
+					},
+				},
+			},
+			filter: AllocationFilterAnd{[]AllocationFilter{
+				AllocationFilterNone{},
+			}},
+			expected: false,
+		},
 	}
 
 	for _, c := range cases {