Skip to content

Commit 90595d3

Browse files
committed
Add a cbor test
1 parent dff520a commit 90595d3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

test/pycardano/test_plutus.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from dataclasses import dataclass, field
1+
from dataclasses import dataclass
2+
import unittest
3+
24
from test.pycardano.util import check_two_way_cbor
3-
from typing import Union, Optional, Dict
5+
from typing import Union, Dict
46

57
import pytest
68

@@ -115,6 +117,17 @@ def test_plutus_data_json_dict():
115117
assert test == DictTest.from_json(encoded_json)
116118

117119

120+
@unittest.skip("Plutus tags not supported for cbor entirely right now")
121+
def test_plutus_data_cbor_dict():
122+
test = DictTest({0: LargestTest(), 1: LargestTest()})
123+
124+
encoded_cbor = test.to_cbor()
125+
126+
assert "d87c9fa200d905028001d9050280ff" == encoded_cbor
127+
128+
assert test == DictTest.from_cbor(encoded_cbor)
129+
130+
118131
def test_plutus_data_to_json_wrong_type():
119132
test = MyTest(123, b"1234", IndefiniteList([4, 5, 6]), {1: b"1", 2: b"2"})
120133
test.a = "123"

0 commit comments

Comments
 (0)