26 lines
485 B
Go
26 lines
485 B
Go
package tests
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"testing"
|
|
)
|
|
|
|
type putImageAliasPayload struct {
|
|
Aliases []string `json:"aliases"`
|
|
}
|
|
|
|
func Test_03_PutImageAliases(t *testing.T) {
|
|
payload := putImageAliasPayload{
|
|
Aliases: []string{"huh"},
|
|
}
|
|
resp, err := client.R().
|
|
SetBody(payload).
|
|
Put(fmt.Sprintf("http://localhost:8080/api/image/%d/aliases",
|
|
image.Id))
|
|
if err != nil || resp.StatusCode() != http.StatusOK {
|
|
t.Logf("%+v", resp)
|
|
t.Fatal("failed to put image alias")
|
|
}
|
|
}
|