1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-30 09:41:19 +00:00
nginx-sso/vendor/github.com/jda/go-crowd/base_test.go

41 lines
704 B
Go
Raw Normal View History

package crowd
import (
"os"
"testing"
)
type TestVars struct {
AppUsername string
AppPassword string
AppURL string
}
// Make sure we have the env vars to run, handle bailing if we don't
func PrepVars(t *testing.T) TestVars {
var tv TestVars
appU := os.Getenv("APP_USERNAME")
if appU == "" {
t.Skip("Can't run test because APP_USERNAME undefined")
} else {
tv.AppUsername = appU
}
appP := os.Getenv("APP_PASSWORD")
if appP == "" {
t.Skip("Can't run test because APP_PASSWORD undefined")
} else {
tv.AppPassword = appP
}
appURL := os.Getenv("APP_URL")
if appURL == "" {
t.Skip("Can't run test because APP_URL undefined")
} else {
tv.AppURL = appURL
}
return tv
}