mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Create a new testclient package that can be backed by disk files
Standardize how our fakes are used so that a test case can use a simpler mechanism for providing large, complex data sets, as well as represent queries over time.
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/testclient"
|
||||
)
|
||||
|
||||
var testPod *api.Pod = &api.Pod{
|
||||
@@ -34,7 +35,7 @@ var testPod *api.Pod = &api.Pod{
|
||||
}
|
||||
|
||||
func newTestStatusManager() *statusManager {
|
||||
return newStatusManager(&client.Fake{})
|
||||
return newStatusManager(&testclient.Fake{})
|
||||
}
|
||||
|
||||
func generateRandomMessage() string {
|
||||
@@ -48,7 +49,7 @@ func getRandomPodStatus() api.PodStatus {
|
||||
}
|
||||
|
||||
func verifyActions(t *testing.T, kubeClient client.Interface, expectedActions []string) {
|
||||
actions := kubeClient.(*client.Fake).Actions
|
||||
actions := kubeClient.(*testclient.Fake).Actions
|
||||
if len(actions) != len(expectedActions) {
|
||||
t.Errorf("unexpected actions, got: %s expected: %s", actions, expectedActions)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user