mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
add unit test coverage for pkg/kubelet/util/queue
Signed-off-by: zhoumingcheng <zhoumingcheng@beyondcent.com>
This commit is contained in:
parent
02462739ca
commit
ca8f3dff9a
@ -20,8 +20,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/utils/clock"
|
||||
testingclock "k8s.io/utils/clock/testing"
|
||||
)
|
||||
|
||||
@ -63,3 +65,19 @@ func TestGetWork(t *testing.T) {
|
||||
compareResults(t, expected, q.GetWork())
|
||||
compareResults(t, []types.UID{}, q.GetWork())
|
||||
}
|
||||
|
||||
func TestNewBasicWorkQueue(t *testing.T) {
|
||||
tests := []struct {
|
||||
clock clock.Clock
|
||||
expectedWorkQueue WorkQueue
|
||||
}{
|
||||
{
|
||||
clock: clock.RealClock{},
|
||||
expectedWorkQueue: &basicWorkQueue{queue: make(map[types.UID]time.Time), clock: clock.RealClock{}},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
workQueue := NewBasicWorkQueue(test.clock)
|
||||
assert.Equal(t, test.expectedWorkQueue, workQueue)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user