mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-05 07:22:54 +03:00
Pull request: home: rm unnecessary func
Merge in DNS/adguard-home from imp-test to master Squashed commit of the following: commit 0ef7812e32b74647b43bb1d69b569e9b102e92b3 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Apr 22 14:12:00 2021 +0300 home: rm unnecessary func
This commit is contained in:
parent
4165e0ef3a
commit
138dfaa85b
4 changed files with 5 additions and 21 deletions
internal/home
|
@ -8,7 +8,6 @@ import (
|
|||
"net/http"
|
||||
"net/textproto"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -22,21 +21,6 @@ func TestMain(m *testing.M) {
|
|||
aghtest.DiscardLogOutput(m)
|
||||
}
|
||||
|
||||
func prepareTestDir(t *testing.T) string {
|
||||
t.Helper()
|
||||
|
||||
const dir = "./agh-test"
|
||||
|
||||
require.Nil(t, os.RemoveAll(dir))
|
||||
// TODO(e.burkov): Replace with testing.TempDir after updating Go
|
||||
// version to 1.16.
|
||||
require.Nil(t, os.MkdirAll(dir, 0o755))
|
||||
|
||||
t.Cleanup(func() { require.Nil(t, os.RemoveAll(dir)) })
|
||||
|
||||
return dir
|
||||
}
|
||||
|
||||
func TestNewSessionToken(t *testing.T) {
|
||||
// Successful case.
|
||||
token, err := newSessionToken()
|
||||
|
@ -57,7 +41,7 @@ func TestNewSessionToken(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAuth(t *testing.T) {
|
||||
dir := prepareTestDir(t)
|
||||
dir := t.TempDir()
|
||||
fn := filepath.Join(dir, "sessions.db")
|
||||
|
||||
users := []User{{
|
||||
|
@ -132,7 +116,7 @@ func (w *testResponseWriter) WriteHeader(statusCode int) {
|
|||
}
|
||||
|
||||
func TestAuthHTTP(t *testing.T) {
|
||||
dir := prepareTestDir(t)
|
||||
dir := t.TempDir()
|
||||
fn := filepath.Join(dir, "sessions.db")
|
||||
|
||||
users := []User{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue