mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add poller to cache.
This commit is contained in:
13
pkg/client/cache/store_test.go
vendored
13
pkg/client/cache/store_test.go
vendored
@@ -40,10 +40,12 @@ func doTestStore(t *testing.T, store Store) {
|
||||
t.Errorf("expected %v, got %v", e, a)
|
||||
}
|
||||
}
|
||||
store.Delete("foo", "qux")
|
||||
store.Delete("foo")
|
||||
if _, ok := store.Get("foo"); ok {
|
||||
t.Errorf("found deleted item??")
|
||||
}
|
||||
|
||||
// Test List
|
||||
store.Add("a", "b")
|
||||
store.Add("c", "d")
|
||||
store.Add("e", "e")
|
||||
@@ -57,6 +59,15 @@ func doTestStore(t *testing.T, store Store) {
|
||||
if len(found) != 3 {
|
||||
t.Errorf("extra items")
|
||||
}
|
||||
|
||||
// Check that ID list is correct.
|
||||
ids := store.Contains()
|
||||
if !ids.HasAll("a", "c", "e") {
|
||||
t.Errorf("missing items")
|
||||
}
|
||||
if len(ids) != 3 {
|
||||
t.Errorf("extra items")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user