Commit ef9baf31 authored by nolancon's avatar nolancon

Update unit tests for TopologyHints - Topology Manager Policies

parent e82fa41f
......@@ -23,27 +23,25 @@ import (
func TestCanAdmitPodResult1(t *testing.T) {
tcases := []struct {
name string
affinity bool
admit bool
expected bool
}{
{
name: "Affinity is set to false in topology hints",
affinity: false,
admit: false,
expected: true,
},
{
name: "Affinity is set to true in topology hints",
affinity: true,
admit: true,
expected: true,
},
}
for _, tc := range tcases {
policy := NewPreferredPolicy()
hints := TopologyHints{
Affinity: tc.affinity,
}
result := policy.CanAdmitPodResult(hints)
admit := tc.admit
result := policy.CanAdmitPodResult(admit)
if result.Admit != tc.expected {
t.Errorf("Expected Admit field in result to be %t, got %t", tc.expected, result.Admit)
......
......@@ -23,27 +23,25 @@ import (
func TestCanAdmitPodResult(t *testing.T) {
tcases := []struct {
name string
affinity bool
admit bool
expected bool
}{
{
name: "Affinity is set to false in topology hints",
affinity: false,
admit: false,
expected: false,
},
{
name: "Affinity is set to true in topology hints",
affinity: true,
admit: true,
expected: true,
},
}
for _, tc := range tcases {
policy := NewStrictPolicy()
hints := TopologyHints{
Affinity: tc.affinity,
}
result := policy.CanAdmitPodResult(hints)
admit := tc.admit
result := policy.CanAdmitPodResult(admit)
if result.Admit != tc.expected {
t.Errorf("Expected Admit field in result to be %t, got %t", tc.expected, result.Admit)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment