mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
clean testprinter after commit:
https://github.com/kubernetes/kubernetes/pull/60117 modified: pkg/kubectl/cmd/cmd_test.go modified: pkg/kubectl/cmd/resource/get_test.go
This commit is contained in:
parent
5d144152e4
commit
6eee5dd421
@ -122,31 +122,6 @@ func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList)
|
|||||||
return pods, svc, rc
|
return pods, svc, rc
|
||||||
}
|
}
|
||||||
|
|
||||||
type testPrinter struct {
|
|
||||||
Objects []runtime.Object
|
|
||||||
Err error
|
|
||||||
GenericPrinter bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) PrintObj(obj runtime.Object, out io.Writer) error {
|
|
||||||
t.Objects = append(t.Objects, obj)
|
|
||||||
fmt.Fprintf(out, "%#v", obj)
|
|
||||||
return t.Err
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: implement HandledResources()
|
|
||||||
func (t *testPrinter) HandledResources() []string {
|
|
||||||
return []string{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) AfterPrint(output io.Writer, res string) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) IsGeneric() bool {
|
|
||||||
return t.GenericPrinter
|
|
||||||
}
|
|
||||||
|
|
||||||
type testDescriber struct {
|
type testDescriber struct {
|
||||||
Name, Namespace string
|
Name, Namespace string
|
||||||
Settings printers.DescriberSettings
|
Settings printers.DescriberSettings
|
||||||
|
@ -82,31 +82,6 @@ func defaultClientConfig() *restclient.Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type testPrinter struct {
|
|
||||||
Objects []runtime.Object
|
|
||||||
Err error
|
|
||||||
GenericPrinter bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) PrintObj(obj runtime.Object, out io.Writer) error {
|
|
||||||
t.Objects = append(t.Objects, obj)
|
|
||||||
fmt.Fprintf(out, "%#v", obj)
|
|
||||||
return t.Err
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: implement HandledResources()
|
|
||||||
func (t *testPrinter) HandledResources() []string {
|
|
||||||
return []string{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) AfterPrint(output io.Writer, res string) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *testPrinter) IsGeneric() bool {
|
|
||||||
return t.GenericPrinter
|
|
||||||
}
|
|
||||||
|
|
||||||
func objBody(codec runtime.Codec, obj runtime.Object) io.ReadCloser {
|
func objBody(codec runtime.Codec, obj runtime.Object) io.ReadCloser {
|
||||||
return ioutil.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(codec, obj))))
|
return ioutil.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(codec, obj))))
|
||||||
}
|
}
|
||||||
@ -245,7 +220,6 @@ func TestGetUnknownSchemaObject(t *testing.T) {
|
|||||||
|
|
||||||
expected := []runtime.Object{cmdtesting.NewInternalType("", "", "foo")}
|
expected := []runtime.Object{cmdtesting.NewInternalType("", "", "foo")}
|
||||||
actual := []runtime.Object{}
|
actual := []runtime.Object{}
|
||||||
//actual := tf.Printer.(*testPrinter).Objects
|
|
||||||
if len(actual) != len(expected) {
|
if len(actual) != len(expected) {
|
||||||
t.Fatalf("expected: %#v, but actual: %#v", expected, actual)
|
t.Fatalf("expected: %#v, but actual: %#v", expected, actual)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user