Files
backend/tests/05_getImages_test.go
2025-12-07 23:59:24 +08:00

29 lines
740 B
Go

package tests
import (
"net/http"
"strconv"
"testing"
)
func Test_05_GetImages(t *testing.T) {
t.Run("check with alias id", func(t *testing.T) {
resp, err := client.R().
SetQueryParam("aliases", strconv.FormatInt(aliases[0].Id, 10)).
Get("http://localhost:8080/api/images")
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to get images by alias id")
}
})
t.Run("check with image id", func(t *testing.T) {
resp, err := client.R().
SetQueryParam("images", strconv.FormatInt(image.Id, 10)).
Get("http://localhost:8080/api/images")
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to get images by image id")
}
})
}