Feat: add more tests
This commit is contained in:
21
tests/06_getImage_test.go
Normal file
21
tests/06_getImage_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user