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

@@ -29,6 +29,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/fake"
)
type fakeRemoteExecutor struct {
@@ -97,9 +98,9 @@ func TestPodAndContainer(t *testing.T) {
}
for _, test := range tests {
f, tf, codec := NewAPIFactory()
tf.Client = &client.FakeRESTClient{
tf.Client = &fake.RESTClient{
Codec: codec,
Client: client.HTTPClientFunc(func(req *http.Request) (*http.Response, error) { return nil, nil }),
Client: fake.HTTPClientFunc(func(req *http.Request) (*http.Response, error) { return nil, nil }),
}
tf.Namespace = "test"
tf.ClientConfig = &client.Config{}
@@ -153,9 +154,9 @@ func TestExec(t *testing.T) {
}
for _, test := range tests {
f, tf, codec := NewAPIFactory()
tf.Client = &client.FakeRESTClient{
tf.Client = &fake.RESTClient{
Codec: codec,
Client: client.HTTPClientFunc(func(req *http.Request) (*http.Response, error) {
Client: fake.HTTPClientFunc(func(req *http.Request) (*http.Response, error) {
switch p, m := req.URL.Path, req.Method; {
case p == test.podPath && m == "GET":
body := objBody(codec, test.pod)