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

@@ -26,6 +26,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"
"k8s.io/kubernetes/pkg/runtime"
)
@@ -326,9 +327,9 @@ func TestLabelErrors(t *testing.T) {
func TestLabelForResourceFromFile(t *testing.T) {
pods, _, _ := testData()
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 req.Method {
case "GET":
switch req.URL.Path {
@@ -373,9 +374,9 @@ func TestLabelForResourceFromFile(t *testing.T) {
func TestLabelMultipleObjects(t *testing.T) {
pods, _, _ := testData()
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 req.Method {
case "GET":
switch req.URL.Path {