move client/unversioned/fake.go to its own package

This commit is contained in:
Chao Xu
2015-09-11 13:47:53 -07:00
parent fbde485548
commit ac5481d089
21 changed files with 320 additions and 284 deletions

View File

@@ -32,7 +32,7 @@ import (
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/testapi"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/fake"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/errors"
"k8s.io/kubernetes/pkg/watch"
@@ -54,15 +54,15 @@ func watchBody(events ...watch.Event) string {
func fakeClient() ClientMapper {
return ClientMapperFunc(func(*meta.RESTMapping) (RESTClient, error) {
return &client.FakeRESTClient{}, nil
return &fake.RESTClient{}, nil
})
}
func fakeClientWith(testName string, t *testing.T, data map[string]string) ClientMapper {
return ClientMapperFunc(func(*meta.RESTMapping) (RESTClient, error) {
return &client.FakeRESTClient{
return &fake.RESTClient{
Codec: testapi.Default.Codec(),
Client: client.HTTPClientFunc(func(req *http.Request) (*http.Response, error) {
Client: fake.HTTPClientFunc(func(req *http.Request) (*http.Response, error) {
p := req.URL.Path
q := req.URL.RawQuery
if len(q) != 0 {