From bf8312a547158d8eea91eee2d2e956fbc6e09e07 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Sat, 4 Jun 2022 16:45:25 +0300 Subject: [PATCH] [#263] session: Add `Sign` / `VerifySignature` test Signed-off-by: Leonard Lyubich --- session/container_test.go | 8 ++++++++ session/object_test.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/session/container_test.go b/session/container_test.go index c35ba414..cb908cda 100644 --- a/session/container_test.go +++ b/session/container_test.go @@ -535,3 +535,11 @@ func TestContainer_Issuer(t *testing.T) { require.True(t, token.Issuer().Equals(issuer)) } + +func TestContainer_Sign(t *testing.T) { + val := sessiontest.Container() + + require.NoError(t, val.Sign(randSigner())) + + require.True(t, val.VerifySignature()) +} diff --git a/session/object_test.go b/session/object_test.go index 5c7360c1..c2668508 100644 --- a/session/object_test.go +++ b/session/object_test.go @@ -626,3 +626,11 @@ func TestObject_Issuer(t *testing.T) { require.True(t, token.Issuer().Equals(issuer)) } + +func TestObject_Sign(t *testing.T) { + val := sessiontest.Object() + + require.NoError(t, val.Sign(randSigner())) + + require.True(t, val.VerifySignature()) +}