chore: move CAOS_OIDC_DEV to const (and ensure TestValidateIssuer runs (even on machines with env set))

This commit is contained in:
Livio Amstutz 2020-10-07 08:49:23 +02:00
parent b311610d06
commit d6203fb0d5
2 changed files with 6 additions and 2 deletions

View file

@ -60,6 +60,8 @@ func TestValidateIssuer(t *testing.T) {
true,
},
}
//ensure env is not set
os.Unsetenv(OidcDevMode)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := ValidateIssuer(tt.args.issuer); (err != nil) != tt.wantErr {
@ -84,7 +86,7 @@ func TestValidateIssuerDevLocalAllowed(t *testing.T) {
false,
},
}
os.Setenv("CAOS_OIDC_DEV", "")
os.Setenv(OidcDevMode, "true")
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := ValidateIssuer(tt.args.issuer); (err != nil) != tt.wantErr {