patch: use unstructured objects

This commit is contained in:
Jordan Liggitt
2017-01-22 11:38:05 -05:00
parent 89266588d1
commit b6d4f371cd
2 changed files with 14 additions and 10 deletions

View File

@@ -29,11 +29,11 @@ import (
func TestPatchObject(t *testing.T) {
_, svc, _ := testData()
f, tf, codec, ns := cmdtesting.NewAPIFactory()
f, tf, codec, _ := cmdtesting.NewAPIFactory()
tf.Printer = &testPrinter{}
tf.Client = &fake.RESTClient{
tf.UnstructuredClient = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
NegotiatedSerializer: unstructuredSerializer,
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
switch p, m := req.URL.Path, req.Method; {
case p == "/namespaces/test/services/frontend" && (m == "PATCH" || m == "GET"):
@@ -62,11 +62,11 @@ func TestPatchObject(t *testing.T) {
func TestPatchObjectFromFile(t *testing.T) {
_, svc, _ := testData()
f, tf, codec, ns := cmdtesting.NewAPIFactory()
f, tf, codec, _ := cmdtesting.NewAPIFactory()
tf.Printer = &testPrinter{}
tf.Client = &fake.RESTClient{
tf.UnstructuredClient = &fake.RESTClient{
APIRegistry: api.Registry,
NegotiatedSerializer: ns,
NegotiatedSerializer: unstructuredSerializer,
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
switch p, m := req.URL.Path, req.Method; {
case p == "/namespaces/test/services/frontend" && (m == "PATCH" || m == "GET"):