@@ -23,7 +23,7 @@ import (
2323)
2424
2525func TestParseSystemhookPush (t * testing.T ) {
26- payload := loadFixture ("testdata/systemhooks/push.json" )
26+ payload := loadFixture (t , "testdata/systemhooks/push.json" )
2727
2828 parsedEvent , err := ParseSystemhook (payload )
2929 if err != nil {
@@ -38,7 +38,7 @@ func TestParseSystemhookPush(t *testing.T) {
3838}
3939
4040func TestParseSystemhookTagPush (t * testing.T ) {
41- payload := loadFixture ("testdata/systemhooks/tag_push.json" )
41+ payload := loadFixture (t , "testdata/systemhooks/tag_push.json" )
4242
4343 parsedEvent , err := ParseSystemhook (payload )
4444 if err != nil {
@@ -53,7 +53,7 @@ func TestParseSystemhookTagPush(t *testing.T) {
5353}
5454
5555func TestParseSystemhookMergeRequest (t * testing.T ) {
56- payload := loadFixture ("testdata/systemhooks/merge_request.json" )
56+ payload := loadFixture (t , "testdata/systemhooks/merge_request.json" )
5757
5858 parsedEvent , err := ParseSystemhook (payload )
5959 if err != nil {
@@ -68,7 +68,7 @@ func TestParseSystemhookMergeRequest(t *testing.T) {
6868}
6969
7070func TestParseSystemhookRepositoryUpdate (t * testing.T ) {
71- payload := loadFixture ("testdata/systemhooks/repository_update.json" )
71+ payload := loadFixture (t , "testdata/systemhooks/repository_update.json" )
7272
7373 parsedEvent , err := ParseSystemhook (payload )
7474 if err != nil {
@@ -87,11 +87,11 @@ func TestParseSystemhookProject(t *testing.T) {
8787 event string
8888 payload []byte
8989 }{
90- {"project_create" , loadFixture ("testdata/systemhooks/project_create.json" )},
91- {"project_update" , loadFixture ("testdata/systemhooks/project_update.json" )},
92- {"project_destroy" , loadFixture ("testdata/systemhooks/project_destroy.json" )},
93- {"project_transfer" , loadFixture ("testdata/systemhooks/project_transfer.json" )},
94- {"project_rename" , loadFixture ("testdata/systemhooks/project_rename.json" )},
90+ {"project_create" , loadFixture (t , "testdata/systemhooks/project_create.json" )},
91+ {"project_update" , loadFixture (t , "testdata/systemhooks/project_update.json" )},
92+ {"project_destroy" , loadFixture (t , "testdata/systemhooks/project_destroy.json" )},
93+ {"project_transfer" , loadFixture (t , "testdata/systemhooks/project_transfer.json" )},
94+ {"project_rename" , loadFixture (t , "testdata/systemhooks/project_rename.json" )},
9595 }
9696 for _ , tc := range tests {
9797 t .Run (tc .event , func (t * testing.T ) {
@@ -113,9 +113,9 @@ func TestParseSystemhookGroup(t *testing.T) {
113113 event string
114114 payload []byte
115115 }{
116- {"group_create" , loadFixture ("testdata/systemhooks/group_create.json" )},
117- {"group_destroy" , loadFixture ("testdata/systemhooks/group_destroy.json" )},
118- {"group_rename" , loadFixture ("testdata/systemhooks/group_rename.json" )},
116+ {"group_create" , loadFixture (t , "testdata/systemhooks/group_create.json" )},
117+ {"group_destroy" , loadFixture (t , "testdata/systemhooks/group_destroy.json" )},
118+ {"group_rename" , loadFixture (t , "testdata/systemhooks/group_rename.json" )},
119119 }
120120 for _ , tc := range tests {
121121 t .Run (tc .event , func (t * testing.T ) {
@@ -137,10 +137,10 @@ func TestParseSystemhookUser(t *testing.T) {
137137 event string
138138 payload []byte
139139 }{
140- {"user_create" , loadFixture ("testdata/systemhooks/user_create.json" )},
141- {"user_destroy" , loadFixture ("testdata/systemhooks/user_destroy.json" )},
142- {"user_rename" , loadFixture ("testdata/systemhooks/user_rename.json" )},
143- {"user_failed_login" , loadFixture ("testdata/systemhooks/user_failed_login.json" )},
140+ {"user_create" , loadFixture (t , "testdata/systemhooks/user_create.json" )},
141+ {"user_destroy" , loadFixture (t , "testdata/systemhooks/user_destroy.json" )},
142+ {"user_rename" , loadFixture (t , "testdata/systemhooks/user_rename.json" )},
143+ {"user_failed_login" , loadFixture (t , "testdata/systemhooks/user_failed_login.json" )},
144144 }
145145 for _ , tc := range tests {
146146 t .Run (tc .event , func (t * testing.T ) {
@@ -162,9 +162,9 @@ func TestParseSystemhookUserGroup(t *testing.T) {
162162 event string
163163 payload []byte
164164 }{
165- {"user_add_to_group" , loadFixture ("testdata/systemhooks/user_add_to_group.json" )},
166- {"user_remove_from_group" , loadFixture ("testdata/systemhooks/user_remove_from_group.json" )},
167- {"user_update_for_group" , loadFixture ("testdata/systemhooks/user_update_for_group.json" )},
165+ {"user_add_to_group" , loadFixture (t , "testdata/systemhooks/user_add_to_group.json" )},
166+ {"user_remove_from_group" , loadFixture (t , "testdata/systemhooks/user_remove_from_group.json" )},
167+ {"user_update_for_group" , loadFixture (t , "testdata/systemhooks/user_update_for_group.json" )},
168168 }
169169 for _ , tc := range tests {
170170 t .Run (tc .event , func (t * testing.T ) {
@@ -186,9 +186,9 @@ func TestParseSystemhookUserTeam(t *testing.T) {
186186 event string
187187 payload []byte
188188 }{
189- {"user_add_to_team" , loadFixture ("testdata/systemhooks/user_add_to_team.json" )},
190- {"user_remove_from_team" , loadFixture ("testdata/systemhooks/user_remove_from_team.json" )},
191- {"user_update_for_team" , loadFixture ("testdata/systemhooks/user_update_for_team.json" )},
189+ {"user_add_to_team" , loadFixture (t , "testdata/systemhooks/user_add_to_team.json" )},
190+ {"user_remove_from_team" , loadFixture (t , "testdata/systemhooks/user_remove_from_team.json" )},
191+ {"user_update_for_team" , loadFixture (t , "testdata/systemhooks/user_update_for_team.json" )},
192192 }
193193 for _ , tc := range tests {
194194 t .Run (tc .event , func (t * testing.T ) {
@@ -206,11 +206,11 @@ func TestParseSystemhookUserTeam(t *testing.T) {
206206}
207207
208208func TestParseHookSystemHook (t * testing.T ) {
209- parsedEvent1 , err := ParseHook ("System Hook" , loadFixture ("testdata/systemhooks/merge_request.json" ))
209+ parsedEvent1 , err := ParseHook ("System Hook" , loadFixture (t , "testdata/systemhooks/merge_request.json" ))
210210 if err != nil {
211211 t .Errorf ("Error parsing build hook: %s" , err )
212212 }
213- parsedEvent2 , err := ParseSystemhook (loadFixture ("testdata/systemhooks/merge_request.json" ))
213+ parsedEvent2 , err := ParseSystemhook (loadFixture (t , "testdata/systemhooks/merge_request.json" ))
214214 if err != nil {
215215 t .Errorf ("Error parsing build hook: %s" , err )
216216 }
0 commit comments