Feat: add more tests

This commit is contained in:
2025-12-07 23:59:24 +08:00
parent 1f313fc17d
commit f191aef810
17 changed files with 307 additions and 25 deletions

21
tests/06_getImage_test.go Normal file
View File

@@ -0,0 +1,21 @@
package tests
import (
"bytes"
"fmt"
"net/http"
"testing"
)
func Test_06_GetImage(t *testing.T) {
resp, err := client.R().
Get(fmt.Sprintf("http://localhost:8080/img/%d.%s",
image.Id, image.Extension))
if err != nil || resp.StatusCode() != http.StatusOK {
t.Fatal("failed to get image")
}
if bytes.Compare(rawImage, resp.Body()) != 0 {
t.Fatal("image differ")
}
}