From 9d70ccdc6b50c8c5202b60935d4946b03ea5cde4 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 20 Dec 2024 12:38:41 +0100 Subject: dashboard/app: test dashapi CreateUploadURL --- dashboard/app/api_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dashboard/app/api_test.go') diff --git a/dashboard/app/api_test.go b/dashboard/app/api_test.go index 37b3137de..dae783e19 100644 --- a/dashboard/app/api_test.go +++ b/dashboard/app/api_test.go @@ -302,3 +302,18 @@ func TestUpdateReportingPriority(t *testing.T) { // "0-3", "4-5" have the same priority (repro revoked as no repro). assert.Equal(t, len(slices.Compact(prios)), len(prios)-4) } + +func TestCreateUploadURL(t *testing.T) { + c := NewCtx(t) + defer c.Close() + + c.transformContext = func(c context.Context) context.Context { + newConfig := *getConfig(c) + newConfig.UploadBucket = "blobstorage" + return contextWithConfig(c, &newConfig) + } + + url, err := c.client.CreateUploadURL() + assert.NoError(t, err) + 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) +} -- cgit mrf-deployment