refactor(msg): tests - update data/ennoblements - add check if r.Method == "GET"
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dawid Wysokiński 2023-02-26 07:15:28 +01:00
parent fca59c0a56
commit 419c23673d
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892

View File

@ -79,6 +79,11 @@ func TestUpdateData(t *testing.T) {
// client
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
url, err := urlpkg.Parse(r.URL.Query().Get("url"))
if err != nil {
w.WriteHeader(http.StatusBadRequest)
@ -318,6 +323,11 @@ func TestUpdateEnnoblements(t *testing.T) {
// client
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
url, err := urlpkg.Parse(r.URL.Query().Get("url"))
if err != nil {
w.WriteHeader(http.StatusBadRequest)