Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
99012d11
Commit
99012d11
authored
Oct 19, 2018
by
Patrick Webster
Committed by
Sander van Harmelen
Oct 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding test for version api endpoint (#495)
parent
f1b5bba0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
version_test.go
version_test.go
+29
-0
No files found.
version_test.go
0 → 100644
View file @
99012d11
package
gitlab
import
(
"fmt"
"net/http"
"reflect"
"testing"
)
func
TestGetVersion
(
t
*
testing
.
T
)
{
mux
,
server
,
client
:=
setup
()
defer
teardown
(
server
)
mux
.
HandleFunc
(
"/api/v4/version"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
testMethod
(
t
,
r
,
"GET"
)
fmt
.
Fprint
(
w
,
`{"version":"11.3.4-ee", "revision":"14d3a1d"}`
)
})
version
,
_
,
err
:=
client
.
Version
.
GetVersion
()
if
err
!=
nil
{
t
.
Errorf
(
"Version.GetVersion returned error: %v"
,
err
)
}
want
:=
&
Version
{
Version
:
"11.3.4-ee"
,
Revision
:
"14d3a1d"
}
if
!
reflect
.
DeepEqual
(
want
,
version
)
{
t
.
Errorf
(
"Version.GetVersion returned %+v, want %+v"
,
version
,
want
)
}
}
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