mirror of
https://github.com/kubernetes/client-go.git
synced 2026-08-08 23:26:27 +00:00
client-go/clients: improve TestWatchListSemanticsSimple
Kubernetes-commit: 6b82a823b1a91e727d510b2eeab8765f942ad449
This commit is contained in:
committed by
Kubernetes Publisher
parent
91dcaf4e5c
commit
42503cca34
@@ -18,6 +18,7 @@ package dynamicinformer_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -68,6 +69,12 @@ func TestWatchListSemanticsSimple(t *testing.T) {
|
||||
clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true)
|
||||
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
if _, ok := req.URL.Query()["watch"]; !ok {
|
||||
t.Errorf("expected a watch request, params: %v", req.URL.Query())
|
||||
http.Error(w, fmt.Errorf("unexpected request").Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
obj := &appsv1.Deployment{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: "apps/v1",
|
||||
|
||||
@@ -19,6 +19,7 @@ package metadatainformer
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@@ -52,6 +53,12 @@ func TestWatchListSemanticsSimple(t *testing.T) {
|
||||
clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true)
|
||||
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
if _, ok := req.URL.Query()["watch"]; !ok {
|
||||
t.Errorf("expected a watch request, params: %v", req.URL.Query())
|
||||
http.Error(w, fmt.Errorf("unexpected request").Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
obj := &metav1.PartialObjectMetadata{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: "meta.k8s.io/v1",
|
||||
|
||||
Reference in New Issue
Block a user