Skip to content

Commit e51d98c

Browse files
committed
Add a cbor test
1 parent 91ea5da commit e51d98c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/pycardano/test_plutus.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import unittest
2+
13
from dataclasses import dataclass
24
from test.pycardano.util import check_two_way_cbor
35
from typing import Union, Dict
@@ -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)