Skip to content

Commit 9d70ccd

Browse files
committed
dashboard/app: test dashapi CreateUploadURL
1 parent fbda11f commit 9d70ccd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dashboard/app/api_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,18 @@ func TestUpdateReportingPriority(t *testing.T) {
302302
// "0-3", "4-5" have the same priority (repro revoked as no repro).
303303
assert.Equal(t, len(slices.Compact(prios)), len(prios)-4)
304304
}
305+
306+
func TestCreateUploadURL(t *testing.T) {
307+
c := NewCtx(t)
308+
defer c.Close()
309+
310+
c.transformContext = func(c context.Context) context.Context {
311+
newConfig := *getConfig(c)
312+
newConfig.UploadBucket = "blobstorage"
313+
return contextWithConfig(c, &newConfig)
314+
}
315+
316+
url, err := c.client.CreateUploadURL()
317+
assert.NoError(t, err)
318+
assert.Regexp(t, "blobstorage/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.upload", url)
319+
}

0 commit comments

Comments
 (0)