test(oidc): fix disabled tests (#3173)

pull/3175/head
James Elliott 2022-04-12 13:02:12 +10:00 committed by GitHub
parent 3917ef9dcf
commit 85a88de24d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 8 deletions

View File

@ -1,6 +1,15 @@
package oidc
/*
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/authelia/authelia/v4/internal/authorization"
"github.com/authelia/authelia/v4/internal/configuration/schema"
)
func TestOpenIDConnectStore_GetClientPolicy(t *testing.T) {
s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{
@ -21,7 +30,7 @@ func TestOpenIDConnectStore_GetClientPolicy(t *testing.T) {
Secret: "mysecret",
},
},
})
}, nil)
policyOne := s.GetClientPolicy("myclient")
assert.Equal(t, authorization.OneFactor, policyOne)
@ -45,7 +54,7 @@ func TestOpenIDConnectStore_GetInternalClient(t *testing.T) {
Secret: "mysecret",
},
},
})
}, nil)
client, err := s.GetClient(context.Background(), "myinvalidclient")
assert.EqualError(t, err, "not_found")
@ -69,7 +78,7 @@ func TestOpenIDConnectStore_GetInternalClient_ValidClient(t *testing.T) {
s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{
IssuerPrivateKey: exampleIssuerPrivateKey,
Clients: []schema.OpenIDConnectClientConfiguration{c1},
})
}, nil)
client, err := s.GetFullClient(c1.ID)
require.NoError(t, err)
@ -96,7 +105,7 @@ func TestOpenIDConnectStore_GetInternalClient_InvalidClient(t *testing.T) {
s := NewOpenIDConnectStore(&schema.OpenIDConnectConfiguration{
IssuerPrivateKey: exampleIssuerPrivateKey,
Clients: []schema.OpenIDConnectClientConfiguration{c1},
})
}, nil)
client, err := s.GetFullClient("another-client")
assert.Nil(t, client)
@ -115,12 +124,11 @@ func TestOpenIDConnectStore_IsValidClientID(t *testing.T) {
Secret: "mysecret",
},
},
})
}, nil)
validClient := s.IsValidClientID("myclient")
invalidClient := s.IsValidClientID("myinvalidclient")
assert.True(t, validClient)
assert.False(t, invalidClient)
}.
*/
}