mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-22 13:05:36 +03:00
10f03b7527
Merge in DNS/adguard-home from 2667-eperm-dhcp to master Updates #2667. Squashed commit of the following: commit 7fad607ae0ae75419005707ee58312bc64fe78c5 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Feb 12 16:27:59 2021 +0300 dhcpd: assume static ip on eperm
23 lines
487 B
Go
23 lines
487 B
Go
package dhcpd
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestServer_notImplemented(t *testing.T) {
|
|
s := &Server{}
|
|
h := s.notImplemented("never!")
|
|
|
|
w := httptest.NewRecorder()
|
|
r, err := http.NewRequest(http.MethodGet, "/unsupported", nil)
|
|
require.Nil(t, err)
|
|
|
|
h(w, r)
|
|
assert.Equal(t, http.StatusNotImplemented, w.Code)
|
|
assert.Equal(t, `{"message":"never!"}`+"\n", w.Body.String())
|
|
}
|