test: enforce tenv usage in tests
This commit is contained in:
parent
20f5f050f3
commit
3fca6c0bf5
5 changed files with 8 additions and 11 deletions
|
@ -6,7 +6,6 @@ package base
|
|||
import (
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -168,9 +167,9 @@ func TestInt64sToStrings(t *testing.T) {
|
|||
// TODO: Test EntryIcon
|
||||
|
||||
func TestSetupGiteaRoot(t *testing.T) {
|
||||
_ = os.Setenv("GITEA_ROOT", "test")
|
||||
t.Setenv("GITEA_ROOT", "test")
|
||||
assert.Equal(t, "test", SetupGiteaRoot())
|
||||
_ = os.Setenv("GITEA_ROOT", "")
|
||||
t.Setenv("GITEA_ROOT", "")
|
||||
assert.NotEqual(t, "test", SetupGiteaRoot())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue