Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
58ceb231
Commit
58ceb231
authored
Mar 02, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use testCases instead of dataList
parent
33e0e1f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
internal/builds/register_test.go
internal/builds/register_test.go
+6
-3
internal/helper/helpers_test.go
internal/helper/helpers_test.go
+1
-1
No files found.
internal/builds/register_test.go
View file @
58ceb231
...
...
@@ -53,10 +53,13 @@ func TestRegisterHandlerInvalidJsonPayload(t *testing.T) {
}
func
TestRegisterHandlerMissingData
(
t
*
testing
.
T
)
{
dataList
:=
[]
string
{
`{"token":"token"}`
,
`{"last_update":"data"}`
}
testCases
:=
[]
string
{
`{"token":"token"}`
,
`{"last_update":"data"}`
,
}
for
_
,
data
:=
range
dataList
{
expectHandler
(
t
,
data
,
"application/json"
,
http
.
StatusOK
,
for
_
,
testCase
:=
range
testCases
{
expectHandler
(
t
,
testCase
,
"application/json"
,
http
.
StatusOK
,
"fails on argument validation and proxies request to upstream"
)
}
}
...
...
internal/helper/helpers_test.go
View file @
58ceb231
...
...
@@ -68,7 +68,7 @@ func TestReadRequestBodyLimit(t *testing.T) {
rw
:=
httptest
.
NewRecorder
()
req
,
_
:=
http
.
NewRequest
(
"POST"
,
"/test"
,
bytes
.
NewBuffer
(
data
))
result
,
err
:=
ReadRequestBody
(
rw
,
req
,
2
)
_
,
err
:=
ReadRequestBody
(
rw
,
req
,
2
)
assert
.
Error
(
t
,
err
)
}
...
...
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