Update tests to use new envs instead of legacy

This commit is contained in:
Łukasz Mierzwa
2018-01-31 21:26:40 -08:00
parent 94ec8f084f
commit 1ff002f979

View File

@@ -59,8 +59,8 @@ func TestIndex(t *testing.T) {
}
func TestIndexPrefix(t *testing.T) {
os.Setenv("WEB_PREFIX", "/prefix")
defer os.Unsetenv("WEB_PREFIX")
os.Setenv("LISTEN_PREFIX", "/prefix")
defer os.Unsetenv("LISTEN_PREFIX")
mockConfig()
r := ginTestEngine()
req, _ := http.NewRequest("GET", "/prefix/", nil)
@@ -83,8 +83,8 @@ func TestHelp(t *testing.T) {
}
func TestHelpPrefix(t *testing.T) {
os.Setenv("WEB_PREFIX", "/prefix")
defer os.Unsetenv("WEB_PREFIX")
os.Setenv("LISTEN_PREFIX", "/prefix")
defer os.Unsetenv("LISTEN_PREFIX")
mockConfig()
r := ginTestEngine()
req, _ := http.NewRequest("GET", "/prefix/help", nil)
@@ -447,8 +447,8 @@ var staticFilePrefixTests = []staticFileTestCase{
}
func TestStaticFilesPrefix(t *testing.T) {
os.Setenv("WEB_PREFIX", "/sub")
defer os.Unsetenv("WEB_PREFIX")
os.Setenv("LISTEN_PREFIX", "/sub")
defer os.Unsetenv("LISTEN_PREFIX")
mockConfig()
r := ginTestEngine()
for _, staticFileTest := range staticFilePrefixTests {