Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
0
Merge Requests
0
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-shell
Commits
f62e3e7c
Commit
f62e3e7c
authored
Sep 20, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logic errors in gitlabnet client tests
parent
996b2e1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
go/internal/gitlabnet/client_test.go
go/internal/gitlabnet/client_test.go
+8
-8
No files found.
go/internal/gitlabnet/client_test.go
View file @
f62e3e7c
...
...
@@ -117,11 +117,11 @@ func TestClients(t *testing.T) {
func
testSuccessfulGet
(
t
*
testing
.
T
,
client
*
GitlabClient
)
{
t
.
Run
(
"Successful get"
,
func
(
t
*
testing
.
T
)
{
response
,
err
:=
client
.
Get
(
"/hello"
)
defer
response
.
Body
.
Close
()
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
response
)
defer
response
.
Body
.
Close
()
responseBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
string
(
responseBody
),
"Hello"
)
...
...
@@ -133,11 +133,11 @@ func testSuccessfulPost(t *testing.T, client *GitlabClient) {
data
:=
map
[
string
]
string
{
"key"
:
"value"
}
response
,
err
:=
client
.
Post
(
"/post_endpoint"
,
data
)
defer
response
.
Body
.
Close
()
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
response
)
defer
response
.
Body
.
Close
()
responseBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
"Echo: {
\"
key
\"
:
\"
value
\"
}"
,
string
(
responseBody
))
...
...
@@ -189,11 +189,11 @@ func testBrokenRequest(t *testing.T, client *GitlabClient) {
func
testAuthenticationHeader
(
t
*
testing
.
T
,
client
*
GitlabClient
)
{
t
.
Run
(
"Authentication headers for GET"
,
func
(
t
*
testing
.
T
)
{
response
,
err
:=
client
.
Get
(
"/auth"
)
defer
response
.
Body
.
Close
()
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
response
)
defer
response
.
Body
.
Close
()
responseBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
require
.
NoError
(
t
,
err
)
...
...
@@ -204,11 +204,11 @@ func testAuthenticationHeader(t *testing.T, client *GitlabClient) {
t
.
Run
(
"Authentication headers for POST"
,
func
(
t
*
testing
.
T
)
{
response
,
err
:=
client
.
Post
(
"/auth"
,
map
[
string
]
string
{})
defer
response
.
Body
.
Close
()
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
response
)
defer
response
.
Body
.
Close
()
responseBody
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
require
.
NoError
(
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