AdGuardHome/internal/dhcpd/http_windows_internal_test.go
Stanislav Chzhen ee91a6084f Pull request 2361: imp-test-file-names
Merge in DNS/adguard-home from imp-test-file-names to master

Squashed commit of the following:

commit a0827efdf6
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 10 21:41:46 2025 +0300

    all: imp tests

commit 21fc274d92
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 10 19:40:40 2025 +0300

    all: imp test file names
2025-03-11 19:40:14 +03:00

28 lines
608 B
Go

//go:build windows
package dhcpd
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestServer_notImplemented(t *testing.T) {
s := &server{}
w := httptest.NewRecorder()
r, err := http.NewRequest(http.MethodGet, "/unsupported", nil)
require.NoError(t, err)
s.notImplemented(w, r)
assert.Equal(t, http.StatusNotImplemented, w.Code)
wantStr := fmt.Sprintf("{%q:%q}", "message", aghos.Unsupported("dhcp"))
assert.JSONEq(t, wantStr, w.Body.String())
}