mirror of
https://gitea.com/gitea/tea.git
synced 2026-04-26 02:03:30 +02:00
Fix lint
This commit is contained in:
@@ -148,11 +148,11 @@ func TestWebhookConfigConstruction(t *testing.T) {
|
||||
|
||||
func TestWebhookCreateOptions(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
webhookType string
|
||||
events []string
|
||||
active bool
|
||||
config map[string]string
|
||||
name string
|
||||
webhookType string
|
||||
events []string
|
||||
active bool
|
||||
config map[string]string
|
||||
branchFilter string
|
||||
authHeader string
|
||||
}{
|
||||
|
||||
@@ -128,10 +128,10 @@ func TestUpdateActiveInactiveFlags(t *testing.T) {
|
||||
func TestUpdateConfigPreservation(t *testing.T) {
|
||||
// Test that existing configuration is preserved when not updated
|
||||
originalConfig := map[string]string{
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
@@ -145,32 +145,32 @@ func TestUpdateConfigPreservation(t *testing.T) {
|
||||
"url": "https://new.example.com/webhook",
|
||||
},
|
||||
expectedConfig: map[string]string{
|
||||
"url": "https://new.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
"url": "https://new.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Update secret",
|
||||
updates: map[string]string{
|
||||
"secret": "new-secret",
|
||||
"secret": "new-secret",
|
||||
},
|
||||
expectedConfig: map[string]string{
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "new-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "new-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "No updates",
|
||||
updates: map[string]string{},
|
||||
expectedConfig: map[string]string{
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
"url": "https://old.example.com/webhook",
|
||||
"secret": "old-secret",
|
||||
"http_method": "post",
|
||||
"content_type": "json",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -214,12 +214,12 @@ func TestUpdateBranchFilterAndAuthHeaderHandling(t *testing.T) {
|
||||
expectedAuthHeader: "Bearer old-token",
|
||||
},
|
||||
{
|
||||
name: "Update branch filter",
|
||||
originalBranchFilter: "main",
|
||||
setBranchFilter: true,
|
||||
newBranchFilter: "develop",
|
||||
expectedBranchFilter: "develop",
|
||||
expectedAuthHeader: "",
|
||||
name: "Update branch filter",
|
||||
originalBranchFilter: "main",
|
||||
setBranchFilter: true,
|
||||
newBranchFilter: "develop",
|
||||
expectedBranchFilter: "develop",
|
||||
expectedAuthHeader: "",
|
||||
},
|
||||
{
|
||||
name: "Update authorization header",
|
||||
|
||||
Reference in New Issue
Block a user