Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6eee5dd4
Commit
6eee5dd4
authored
Feb 24, 2018
by
WanLinghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
parent
5d144152
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
51 deletions
+0
-51
cmd_test.go
pkg/kubectl/cmd/cmd_test.go
+0
-25
get_test.go
pkg/kubectl/cmd/resource/get_test.go
+0
-26
No files found.
pkg/kubectl/cmd/cmd_test.go
View file @
6eee5dd4
...
@@ -122,31 +122,6 @@ func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList)
...
@@ -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
...
...
pkg/kubectl/cmd/resource/get_test.go
View file @
6eee5dd4
...
@@ -82,31 +82,6 @@ func defaultClientConfig() *restclient.Config {
...
@@ -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) {
...
@@ -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
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment