forked from TrueCloudLab/frostfs-api-go
[#168] acl: Implement binary/JSON encoders/decoders on TokenLifetime
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
233756ca8f
commit
0f4d5d5f1e
4 changed files with 45 additions and 4 deletions
|
@ -57,3 +57,15 @@ func TestTable_MarshalJSON(t *testing.T) {
|
|||
|
||||
require.Equal(t, tab, tab2)
|
||||
}
|
||||
|
||||
func TestTokenLifetimeJSON(t *testing.T) {
|
||||
l := generateLifetime(1, 2, 3)
|
||||
|
||||
data, err := l.MarshalJSON()
|
||||
require.NoError(t, err)
|
||||
|
||||
l2 := new(acl.TokenLifetime)
|
||||
require.NoError(t, l2.UnmarshalJSON(data))
|
||||
|
||||
require.Equal(t, l, l2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue