mirror of https://github.com/k3s-io/k3s
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.gopull/8/head
parent
5d144152e4
commit
6eee5dd421
|
@ -122,31 +122,6 @@ func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList)
|
|||
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 {
|
||||
Name, Namespace string
|
||||
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 {
|
||||
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")}
|
||||
actual := []runtime.Object{}
|
||||
//actual := tf.Printer.(*testPrinter).Objects
|
||||
if len(actual) != len(expected) {
|
||||
t.Fatalf("expected: %#v, but actual: %#v", expected, actual)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue