Fix: rotate access token and add test

This commit is contained in:
2025-12-07 22:06:32 +08:00
parent 8d3cd0260e
commit 1ce2174bdc
7 changed files with 46 additions and 12 deletions

View File

@@ -67,6 +67,7 @@ func Test_01_Login(t *testing.T) {
if len(cookie.Value) == 0 {
t.Fatal("empty refresh token")
}
client.SetCookie(cookie)
return
}
}

View File

@@ -0,0 +1,15 @@
package main
import (
"net/http"
"testing"
)
func Test_02_GetImages(t *testing.T) {
resp, err := client.R().
Get("http://localhost:8080/api/aliases")
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to fetch aliases")
}
}

View File

@@ -1,6 +0,0 @@
package main
import "testing"
func Test_02_GetImages(t *testing.T) {
}