Pull request: dhcpd: assume static ip on eperm
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
This commit is contained in:
23
internal/dhcpd/http_test.go
Normal file
23
internal/dhcpd/http_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user