all: use tstest.Replace more

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-03-04 12:04:55 -08:00
committed by Maisem Ali
parent 57a44846ae
commit 1a30b2d73f
12 changed files with 35 additions and 58 deletions

View File

@@ -14,6 +14,7 @@ import (
"tailscale.com/client/tailscale/apitype"
"tailscale.com/hostinfo"
"tailscale.com/ipn/ipnlocal"
"tailscale.com/tstest"
)
func TestValidHost(t *testing.T) {
@@ -42,10 +43,7 @@ func TestValidHost(t *testing.T) {
}
func TestSetPushDeviceToken(t *testing.T) {
validLocalHostForTesting = true
defer func() {
validLocalHostForTesting = false
}()
tstest.Replace(t, &validLocalHostForTesting, true)
h := &Handler{
PermitWrite: true,