Skip to content

Commit 219cda7

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

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/pycardano/test_plutus.py

Lines changed: 15 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
@@ -114,6 +116,19 @@ def test_plutus_data_json_dict():
114116

115117
assert test == DictTest.from_json(encoded_json)
116118

119+
@unittest.skip("Plutus tags not supported for cbor entirely right now")
120+
def test_plutus_data_cbor_dict():
121+
test = DictTest({0: LargestTest(), 1: LargestTest()})
122+
123+
encoded_cbor = test.to_cbor()
124+
125+
assert (
126+
'd87c9fa200d905028001d9050280ff'
127+
== encoded_cbor
128+
)
129+
130+
assert test == DictTest.from_cbor(encoded_cbor)
131+
117132

118133
def test_plutus_data_to_json_wrong_type():
119134
test = MyTest(123, b"1234", IndefiniteList([4, 5, 6]), {1: b"1", 2: b"2"})

0 commit comments

Comments
 (0)