Commit 4730326a authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Small fixes to unit tests

parent 12c70eaa
......@@ -59,8 +59,9 @@ func (th TestHandler) RequestVerificationPermission(request irma.DisclosureReque
var candidates []*irma.AttributeIdentifier
for _, disjunction := range request.Content {
candidates = th.client.Candidates(disjunction)
require.NotNil(th.t, candidates)
require.NotEmpty(th.t, candidates, 1)
if len(candidates) == 0 {
th.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("No disclosure candidates found")})
}
choice.Attributes = append(choice.Attributes, candidates[0])
}
callback(true, choice)
......
......@@ -231,11 +231,8 @@ func TestServiceProvider(t *testing.T) {
}`
require.NoError(t, json.Unmarshal([]byte(spjson), &spjwt))
require.NotNil(t, spjwt.Request.Request.Content)
require.NotEmpty(t, spjwt.Request.Request.Content)
require.NotNil(t, spjwt.Request.Request.Content[0])
require.NotEmpty(t, spjwt.Request.Request.Content[0])
require.NotNil(t, spjwt.Request.Request.Content[0].Attributes)
require.NotEmpty(t, spjwt.Request.Request.Content[0].Attributes)
require.Equal(t, spjwt.Request.Request.Content[0].Attributes[0].Name(), "studentID")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment