Files
backend/tests/07_deleteAlias_test.go
Yi-Ting Shih 968c0c5658
All checks were successful
Go test / run-go-vet (push) Successful in 5s
Go test / check-swagger-up-to-date (push) Successful in 8s
Go test / run-go-test (push) Successful in 27s
Go test / cleanup-go-test (push) Successful in 4s
Go test / release-image (push) Successful in 3m34s
Fix: image alias put query
2025-12-13 00:57:05 +08:00

35 lines
674 B
Go

package tests
import (
"fmt"
"net/http"
"testing"
)
func Test_07_DeleteAlias(t *testing.T) {
deleteId := aliases[0].Id
resp, err := client.R().
Delete(fmt.Sprintf("http://localhost:8080/api/alias/%d",
deleteId))
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to delete alias")
}
resp, err = client.R().
SetResult(&aliases).
Get("http://localhost:8080/api/aliases")
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to get aliases")
}
for _, alias := range aliases {
if alias.Id == deleteId {
t.Logf("%+v", resp)
t.Fatal("alias not deleted")
}
}
}