mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
server/forge: rename var to be more descriptive and test value (#5806)
This commit is contained in:
@@ -34,7 +34,7 @@ import (
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
forge, _ := New(0, Opts{
|
||||
forge, _ := New(1, Opts{
|
||||
URL: "http://localhost:8080/",
|
||||
OAuthClientID: "0ZXh0IjoiI",
|
||||
OAuthClientSecret: "I1NiIsInR5",
|
||||
@@ -52,7 +52,7 @@ func Test_github(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
s := httptest.NewServer(fixtures.Handler())
|
||||
c, _ := New(0, Opts{
|
||||
c, _ := New(1, Opts{
|
||||
URL: s.URL,
|
||||
SkipVerify: true,
|
||||
})
|
||||
@@ -62,7 +62,7 @@ func Test_github(t *testing.T) {
|
||||
ctx := t.Context()
|
||||
|
||||
t.Run("netrc with user token", func(t *testing.T) {
|
||||
forge, _ := New(0, Opts{})
|
||||
forge, _ := New(1, Opts{})
|
||||
netrc, _ := forge.Netrc(fakeUser, fakeRepo)
|
||||
assert.Equal(t, "github.com", netrc.Machine)
|
||||
assert.Equal(t, fakeUser.AccessToken, netrc.Login)
|
||||
@@ -70,7 +70,7 @@ func Test_github(t *testing.T) {
|
||||
assert.Equal(t, model.ForgeTypeGithub, netrc.Type)
|
||||
})
|
||||
t.Run("netrc with machine account", func(t *testing.T) {
|
||||
forge, _ := New(0, Opts{})
|
||||
forge, _ := New(1, Opts{})
|
||||
netrc, _ := forge.Netrc(nil, fakeRepo)
|
||||
assert.Equal(t, "github.com", netrc.Machine)
|
||||
assert.Empty(t, netrc.Login)
|
||||
|
||||
Reference in New Issue
Block a user