Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k8s-crt-dnldr
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
k8s
k8s-crt-dnldr
Commits
64ccf633
Commit
64ccf633
authored
Jul 28, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REST API: test GET v1/pems with empty response
parent
09965460
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
allpems_handler_test.go
pkg/rest/allpems_handler_test.go
+16
-0
No files found.
pkg/rest/allpems_handler_test.go
View file @
64ccf633
...
...
@@ -309,6 +309,22 @@ func TestAllPems(t *testing.T) {
t
.
Errorf
(
"HEAD /v1/pems Content-Type: got %s want %s"
,
rr
.
Header
()
.
Get
(
"Content-Type"
),
jsonContentType
)
}
delete
(
files
.
Files
,
"ns1/cafe"
)
delete
(
files
.
Files
,
"ns2/bar"
)
req
=
httptest
.
NewRequest
(
http
.
MethodGet
,
"/v1/pems"
,
nil
)
rr
=
httptest
.
NewRecorder
()
hndlr
.
ServeHTTP
(
rr
,
req
)
if
rr
.
Code
!=
http
.
StatusOK
{
t
.
Errorf
(
"GET /v1/pems status: got %d want %d"
,
rr
.
Code
,
http
.
StatusOK
)
}
if
err
=
json
.
Unmarshal
(
rr
.
Body
.
Bytes
(),
&
allInfo
);
err
!=
nil
{
t
.
Errorf
(
"GET /v1/pems unmarshal: %v"
,
err
)
}
if
len
(
allInfo
)
!=
0
{
t
.
Fatalf
(
"GET /v1/pems len(slice) got %d want 0"
,
len
(
allInfo
))
}
}
func
TestAllPems405
(
t
*
testing
.
T
)
{
...
...
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