|
|
|
@ -135,7 +135,7 @@ func TestHandler_Source(t *testing.T) {
|
|
|
|
|
ctx := context.WithValue(ctx, fsctx.FileModelCtx, file)
|
|
|
|
|
baseURL, err := url.Parse("https://cloudreve.org")
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
sourceURL, err := handler.Source(ctx, "", *baseURL, 0, false)
|
|
|
|
|
sourceURL, err := handler.Source(ctx, "", *baseURL, 0, false, 0)
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
asserts.NotEmpty(sourceURL)
|
|
|
|
|
asserts.Contains(sourceURL, "sign=")
|
|
|
|
@ -146,7 +146,7 @@ func TestHandler_Source(t *testing.T) {
|
|
|
|
|
{
|
|
|
|
|
baseURL, err := url.Parse("https://cloudreve.org")
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
sourceURL, err := handler.Source(ctx, "", *baseURL, 0, false)
|
|
|
|
|
sourceURL, err := handler.Source(ctx, "", *baseURL, 0, false, 0)
|
|
|
|
|
asserts.Error(err)
|
|
|
|
|
asserts.Empty(sourceURL)
|
|
|
|
|
}
|
|
|
|
@ -169,7 +169,7 @@ func TestHandler_GetDownloadURL(t *testing.T) {
|
|
|
|
|
ctx := context.WithValue(ctx, fsctx.FileModelCtx, file)
|
|
|
|
|
baseURL, err := url.Parse("https://cloudreve.org")
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
downloadURL, err := handler.Source(ctx, "", *baseURL, 10, true)
|
|
|
|
|
downloadURL, err := handler.Source(ctx, "", *baseURL, 10, true, 0)
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
asserts.Contains(downloadURL, "sign=")
|
|
|
|
|
asserts.Contains(downloadURL, "https://cloudreve.org")
|
|
|
|
@ -179,7 +179,7 @@ func TestHandler_GetDownloadURL(t *testing.T) {
|
|
|
|
|
{
|
|
|
|
|
baseURL, err := url.Parse("https://cloudreve.org")
|
|
|
|
|
asserts.NoError(err)
|
|
|
|
|
downloadURL, err := handler.Source(ctx, "", *baseURL, 10, true)
|
|
|
|
|
downloadURL, err := handler.Source(ctx, "", *baseURL, 10, true, 0)
|
|
|
|
|
asserts.Error(err)
|
|
|
|
|
asserts.Empty(downloadURL)
|
|
|
|
|
}
|
|
|
|
|