Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
18747054
Commit
18747054
authored
Nov 15, 2019
by
Sietse Ringers
Browse files
test: rename helper function
parent
b6b19997
Changes
1
Hide whitespace changes
Inline
Side-by-side
irmaclient/irmaclient_test.go
View file @
18747054
...
...
@@ -40,7 +40,7 @@ func parseStorage(t *testing.T) *Client {
return
client
}
func
testhelper
(
t
*
testing
.
T
)
(
*
Client
,
*
irma
.
DisclosureRequest
,
*
irma
.
Disclosure
)
{
func
parseDisclosure
(
t
*
testing
.
T
)
(
*
Client
,
*
irma
.
DisclosureRequest
,
*
irma
.
Disclosure
)
{
client
:=
parseStorage
(
t
)
requestJson
:=
`{"@context":"https://irma.app/ld/request/disclosure/v2","context":"AQ==","nonce":"M3LYmTr3CZDYZkMNK2uCCg==","protocolVersion":"2.5","disclose":[[["irma-demo.RU.studentCard.studentID"]]],"labels":{"0":null}}`
...
...
@@ -55,7 +55,7 @@ func testhelper(t *testing.T) (*Client, *irma.DisclosureRequest, *irma.Disclosur
func
TestVerify
(
t
*
testing
.
T
)
{
t
.
Run
(
"valid"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
attr
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
irma
.
ProofStatusValid
,
status
)
...
...
@@ -63,7 +63,7 @@ func TestVerify(t *testing.T) {
})
t
.
Run
(
"invalid"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
disclosure
.
Proofs
[
0
]
.
(
*
gabi
.
ProofD
)
.
AResponses
[
0
]
=
big
.
NewInt
(
100
)
_
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
...
...
@@ -71,7 +71,7 @@ func TestVerify(t *testing.T) {
})
t
.
Run
(
"wrong attribute"
,
func
(
t
*
testing
.
T
)
{
client
,
request
,
disclosure
:=
testhelper
(
t
)
client
,
request
,
disclosure
:=
parseDisclosure
(
t
)
request
.
Disclose
[
0
][
0
][
0
]
.
Type
=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.MijnOverheid.root.BSN"
)
_
,
status
,
err
:=
disclosure
.
Verify
(
client
.
Configuration
,
request
)
require
.
NoError
(
t
,
err
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment