From 61de49fae556b02f7e75b7c557c3ab07831da1e3 Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Thu, 20 Sep 2018 14:35:47 +0200 Subject: [PATCH] protob test fix after migration to get_fields() --- trezorlib/tests/unit_tests/test_protobuf.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/trezorlib/tests/unit_tests/test_protobuf.py b/trezorlib/tests/unit_tests/test_protobuf.py index d4299e6e2..0ea04ea09 100644 --- a/trezorlib/tests/unit_tests/test_protobuf.py +++ b/trezorlib/tests/unit_tests/test_protobuf.py @@ -22,13 +22,15 @@ from trezorlib import protobuf class PrimitiveMessage(protobuf.MessageType): - FIELDS = { - 0: ("uvarint", protobuf.UVarintType, 0), - 1: ("svarint", protobuf.SVarintType, 0), - 2: ("bool", protobuf.BoolType, 0), - 3: ("bytes", protobuf.BytesType, 0), - 4: ("unicode", protobuf.UnicodeType, 0), - } + @classmethod + def get_fields(cls): + return { + 0: ("uvarint", protobuf.UVarintType, 0), + 1: ("svarint", protobuf.SVarintType, 0), + 2: ("bool", protobuf.BoolType, 0), + 3: ("bytes", protobuf.BytesType, 0), + 4: ("unicode", protobuf.UnicodeType, 0), + } def load_uvarint(buffer):