AdGuardHome/internal/dhcpd/http_windows_internal_test.go
Stanislav Chzhen bd64972678 Pull request 2511: AGDNS-3224-fix-windows-test
Squashed commit of the following:

commit a71cf1416595fcc03d70eb0a542bb5fd1611afc5
Merge: 0895e2a86 8f1940f75
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Oct 23 19:00:16 2025 +0300

    Merge branch 'master' into AGDNS-3224-fix-windows-test

commit 0895e2a86437ed224c2c533d2702941a0c5b4730
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Oct 23 18:21:31 2025 +0300

    dhcpd: fix windows test
2025-10-23 19:11:42 +03:00

31 lines
653 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{conf: &ServerConfig{
Logger: testLogger,
}}
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())
}