Feat: add more tests
This commit is contained in:
28
tests/05_getImages_test.go
Normal file
28
tests/05_getImages_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
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")
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user