mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-10-26 11:27:18 +00:00
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
31 lines
653 B
Go
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())
|
|
}
|