@@ -125,11 +125,19 @@ func TestGPGGit(t *testing.T) {
125
125
t .Run ("CreateCRUDFile-Always" , crudActionCreateFile (
126
126
t , testCtx , user , "master" , "always" , "signed-always.txt" , func (t * testing.T , response api.FileResponse ) {
127
127
assert .True (t , response .Verification .Verified )
128
+ if ! response .Verification .Verified {
129
+ t .FailNow ()
130
+ return
131
+ }
128
132
assert .
Equal (
t ,
"[email protected] " ,
response .
Verification .
Signer .
Email )
129
133
}))
130
134
t .Run ("CreateCRUDFile-ParentSigned-always" , crudActionCreateFile (
131
135
t , testCtx , user , "parentsigned" , "parentsigned-always" , "signed-parent2.txt" , func (t * testing.T , response api.FileResponse ) {
132
136
assert .True (t , response .Verification .Verified )
137
+ if ! response .Verification .Verified {
138
+ t .FailNow ()
139
+ return
140
+ }
133
141
assert .
Equal (
t ,
"[email protected] " ,
response .
Verification .
Signer .
Email )
134
142
}))
135
143
})
@@ -144,6 +152,10 @@ func TestGPGGit(t *testing.T) {
144
152
t .Run ("CreateCRUDFile-Always-ParentSigned" , crudActionCreateFile (
145
153
t , testCtx , user , "always" , "always-parentsigned" , "signed-always-parentsigned.txt" , func (t * testing.T , response api.FileResponse ) {
146
154
assert .True (t , response .Verification .Verified )
155
+ if ! response .Verification .Verified {
156
+ t .FailNow ()
157
+ return
158
+ }
147
159
assert .
Equal (
t ,
"[email protected] " ,
response .
Verification .
Signer .
Email )
148
160
}))
149
161
})
@@ -160,6 +172,10 @@ func TestGPGGit(t *testing.T) {
160
172
assert .NotNil (t , branch .Commit )
161
173
assert .NotNil (t , branch .Commit .Verification )
162
174
assert .True (t , branch .Commit .Verification .Verified )
175
+ if ! branch .Commit .Verification .Verified {
176
+ t .FailNow ()
177
+ return
178
+ }
163
179
assert .
Equal (
t ,
"[email protected] " ,
branch .
Commit .
Verification .
Signer .
Email )
164
180
}))
165
181
})
@@ -188,6 +204,10 @@ func TestGPGGit(t *testing.T) {
188
204
t .Run ("CreateCRUDFile-ParentSigned" , crudActionCreateFile (
189
205
t , testCtx , user , "master" , "parentsigned" , "signed-parent.txt" , func (t * testing.T , response api.FileResponse ) {
190
206
assert .True (t , response .Verification .Verified )
207
+ if ! response .Verification .Verified {
208
+ t .FailNow ()
209
+ return
210
+ }
191
211
assert .
Equal (
t ,
"[email protected] " ,
response .
Verification .
Signer .
Email )
192
212
}))
193
213
})
@@ -203,6 +223,10 @@ func TestGPGGit(t *testing.T) {
203
223
t .Run ("CreateCRUDFile-Always" , crudActionCreateFile (
204
224
t , testCtx , user , "master" , "always" , "signed-always.txt" , func (t * testing.T , response api.FileResponse ) {
205
225
assert .True (t , response .Verification .Verified )
226
+ if ! response .Verification .Verified {
227
+ t .FailNow ()
228
+ return
229
+ }
206
230
assert .
Equal (
t ,
"[email protected] " ,
response .
Verification .
Signer .
Email )
207
231
}))
208
232
@@ -289,7 +313,7 @@ func crudActionCreateFile(t *testing.T, ctx APITestContext, user *models.User, f
289
313
Email : user .Email ,
290
314
},
291
315
},
292
- Content : base64 .StdEncoding .EncodeToString ([]byte ("This is new text" )),
316
+ Content : base64 .StdEncoding .EncodeToString ([]byte (fmt . Sprintf ( "This is new text for %s" , path ) )),
293
317
}, callback ... )
294
318
}
295
319
0 commit comments