Skip to content

Commit

Permalink
fix (cbor2): align with linters
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Stypa <[email protected]>
  • Loading branch information
robertstypa committed Nov 6, 2023
1 parent ea24eea commit b2ac822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions suit_generator/suit/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def __init__(self, value):

@staticmethod
def deserialize_cbor(cbstr):
"""Verify and deserialize cbor object."""
if cbstr == b"" or cbstr is None:
raise ValueError("Empty value.")
requested_memory_len = None
Expand All @@ -143,6 +144,7 @@ def deserialize_cbor(cbstr):

@staticmethod
def serialize_cbor(obj):
"""Serialize cbor object."""
try:
return cbor2.dumps(obj)
except cbor2.CBORError:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_suit_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"1b1b1ba4969617587fa18444634d454d4100451a000800004100a60178184e6f726469632053656d69636f6e647563746f7220"
"415341026474657374036e6e6f7264696373656d692e636f6d04745468652074657374206170706c69636174696f6e05781b53"
"616d706c65206170706c69636174696f6e20666f722074657374066676312e302e30"
)
),
}

TEST_DATA_OBJECTS = {
Expand Down

0 comments on commit b2ac822

Please sign in to comment.