Restore original policy none test cases:

Mistakenly overwritten in earlier commit
This commit is contained in:
nolancon 2019-12-19 08:36:18 +00:00
parent 2d1a535a35
commit 6758f95117

View File

@ -40,6 +40,34 @@ func TestPolicyNoneName(t *testing.T) {
}
func TestPolicyNoneCanAdmitPodResult(t *testing.T) {
tcases := []struct {
name string
hint TopologyHint
expected bool
}{
{
name: "Preferred is set to false in topology hints",
hint: TopologyHint{nil, false},
expected: true,
},
{
name: "Preferred is set to true in topology hints",
hint: TopologyHint{nil, true},
expected: true,
},
}
for _, tc := range tcases {
policy := NewNonePolicy()
result := policy.(*nonePolicy).canAdmitPodResult(&tc.hint)
if result.Admit != tc.expected {
t.Errorf("Expected Admit field in result to be %t, got %t", tc.expected, result.Admit)
}
}
}
func TestPolicyNoneMerge(t *testing.T) {
tcases := []struct {
name string
providersHints []map[string][]TopologyHint