22 lines
385 B
Go
22 lines
385 B
Go
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")
|
|
}
|
|
}
|