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