mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 13:38:12 +00:00
19 lines
376 B
Python
19 lines
376 B
Python
|
import common
|
||
|
import unittest
|
||
|
|
||
|
from trezorlib.protobuf_json import json2pb, pb2json
|
||
|
import trezorlib.messages_pb2 as msg
|
||
|
|
||
|
|
||
|
class TestProtobufJson(unittest.TestCase):
|
||
|
|
||
|
def test_pb2json(self):
|
||
|
m = msg.Features()
|
||
|
m.device_id = '1234'
|
||
|
j = pb2json(m)
|
||
|
self.assertEqual(j, {'device_id': u'1234'} )
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main()
|