mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Format code
This commit is contained in:
parent
3884e589a9
commit
5c2938d970
3 changed files with 14 additions and 14 deletions
|
@ -30,13 +30,13 @@ func getRepo(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRepoFile(c *gin.Context) {
|
func getRepoFile(c *gin.Context) {
|
||||||
if c.Param("file") == "file_not_found" {
|
if c.Param("file") == "file_not_found" {
|
||||||
c.String(404, "")
|
c.String(404, "")
|
||||||
}
|
}
|
||||||
if c.Param("commit") == "v1.0.0" || c.Param("commit") == "9ecad50" {
|
if c.Param("commit") == "v1.0.0" || c.Param("commit") == "9ecad50" {
|
||||||
c.String(200, repoFilePayload)
|
c.String(200, repoFilePayload)
|
||||||
}
|
}
|
||||||
c.String(404, "")
|
c.String(404, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func createRepoHook(c *gin.Context) {
|
func createRepoHook(c *gin.Context) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/drone/drone/model"
|
"github.com/drone/drone/model"
|
||||||
"github.com/drone/drone/remote"
|
"github.com/drone/drone/remote"
|
||||||
|
|
|
@ -128,11 +128,11 @@ func Test_gogs(t *testing.T) {
|
||||||
g.Assert(string(raw)).Equal("{ platform: linux/amd64 }")
|
g.Assert(string(raw)).Equal("{ platform: linux/amd64 }")
|
||||||
})
|
})
|
||||||
|
|
||||||
g.It("Should return a repository file from a ref", func() {
|
g.It("Should return a repository file from a ref", func() {
|
||||||
raw, err := c.File(fakeUser, fakeRepo, fakeBuildWithRef, ".drone.yml")
|
raw, err := c.File(fakeUser, fakeRepo, fakeBuildWithRef, ".drone.yml")
|
||||||
g.Assert(err == nil).IsTrue()
|
g.Assert(err == nil).IsTrue()
|
||||||
g.Assert(string(raw)).Equal("{ platform: linux/amd64 }")
|
g.Assert(string(raw)).Equal("{ platform: linux/amd64 }")
|
||||||
})
|
})
|
||||||
|
|
||||||
g.Describe("Given an authentication request", func() {
|
g.Describe("Given an authentication request", func() {
|
||||||
g.It("Should redirect to login form")
|
g.It("Should redirect to login form")
|
||||||
|
@ -185,7 +185,7 @@ var (
|
||||||
Commit: "9ecad50",
|
Commit: "9ecad50",
|
||||||
}
|
}
|
||||||
|
|
||||||
fakeBuildWithRef = &model.Build{
|
fakeBuildWithRef = &model.Build{
|
||||||
Ref: "refs/tags/v1.0.0",
|
Ref: "refs/tags/v1.0.0",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue