test with activity

This commit is contained in:
tsmethurst 2021-04-25 15:06:33 +02:00
commit 501c383c02
4 changed files with 164 additions and 19 deletions

View file

@ -22,6 +22,7 @@ import (
"bytes"
"io"
"mime/multipart"
"net/url"
"os"
)
@ -62,3 +63,13 @@ func CreateMultipartFormData(fieldName string, fileName string, extraFields map[
}
return b, w, nil
}
// URLMustParse tries to parse the given URL and panics if it can't.
// Should only be used in tests.
func URLMustParse(stringURL string) *url.URL {
u, err := url.Parse(stringURL)
if err != nil {
panic(err)
}
return u
}