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
f6ca383e
Commit
f6ca383e
authored
Mar 17, 2018
by
Peter Bouwdewijn
Committed by
Sander van Harmelen
Mar 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ListTagsOptions documentation and add basic test (#354)
parent
f8465d0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
tags.go
tags.go
+1
-1
tags_test.go
tags_test.go
+31
-0
No files found.
tags.go
View file @
f6ca383e
...
...
@@ -49,7 +49,7 @@ func (t Tag) String() string {
// ListTagsOptions represents the available ListTags() options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/
branches.html#lis
t-repository-tags
// https://docs.gitlab.com/ce/api/
tags.html#list-projec
t-repository-tags
type
ListTagsOptions
ListOptions
// ListTags gets a list of tags from a project, sorted by name in reverse
...
...
tags_test.go
0 → 100644
View file @
f6ca383e
package
gitlab
import
(
"fmt"
"net/http"
"reflect"
"testing"
)
func
TestListTags
(
t
*
testing
.
T
)
{
mux
,
server
,
client
:=
setup
()
defer
teardown
(
server
)
mux
.
HandleFunc
(
"/projects/1/repository/tags"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
testMethod
(
t
,
r
,
"GET"
)
fmt
.
Fprint
(
w
,
`[{"name": "1.0.0"},{"name": "1.0.1"}]`
)
})
opt
:=
&
ListTagsOptions
{
Page
:
2
,
PerPage
:
3
}
tags
,
_
,
err
:=
client
.
Tags
.
ListTags
(
1
,
opt
)
if
err
!=
nil
{
t
.
Errorf
(
"Tags.ListTags returned error: %v"
,
err
)
}
want
:=
[]
*
Tag
{{
Name
:
"1.0.0"
},
{
Name
:
"1.0.1"
}}
if
!
reflect
.
DeepEqual
(
want
,
tags
)
{
t
.
Errorf
(
"Tags.ListTags returned %+v, want %+v"
,
tags
,
want
)
}
}
\ No newline at end of file
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